Hello ,
I have 3 pages like
a.html, b.html. c.html in c.html give mail coding.
I have written javascript function use prompt box.
MY condition :
1-when prompt box open and give email id then send mail through c.html page
2- If not give any input value in prompt text box and click on ok/cancel button then mail send through c.html page and return main page like b.html.
ie. after click on cancel button return to b.html page as well as send mail by c.html page?
Please describe how can do this?
Davin MartynPosted Jul 11, 2015, 9:26 AM
Davin MartynPosted Jul 10, 2015, 7:07 AM
Upendra Pratap ShahiPosted Jul 10, 2015, 6:37 AM
Davin MartynPosted Jul 10, 2015, 6:33 AM
Davin MartynPosted Jul 10, 2015, 6:31 AM
Upendra Pratap ShahiPosted Jul 10, 2015, 2:56 AM
Davin MartynPosted Jul 10, 2015, 2:40 AM
Davin MartynPosted Jul 9, 2015, 7:25 AM
Upendra Pratap ShahiPosted Jul 9, 2015, 7:04 AM
DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function CheckValid() {
var XVal = document.getElementById('txtX').value;
var YVal = document.getElementById('txty').value;
if (XVal == "") {
var person = prompt("Please enter your first name", XVal);
document.getElementById('txtX').value = person;
}
if (YVal == "") {
var person = prompt("Please enter your last name", YVal);
document.getElementById('txty').value = person;
}
if (XVal != "" && YVal != "") {
//writecode here
window.location.href = "c.html";
}
else {
window.location.href = "c.html";
//and redirect from c.html to b.html when code executed from c.html
}
}
script>
head>
<body>
<h1>My First JavaScripth1>
First Name :<input type="text" id="txtX" />
Last Name :<input type="text" id="txty" />
<input type="button" onclick="CheckValid();" value="Click" />
<p id="demo">p>
body>
html>
Davin MartynPosted Jul 9, 2015, 5:24 AM