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 MartynRank #285 · 8.8K reputationPosted Jul 9, 2015, 1:24 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 9, 2015, 3:04 AM EDT
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 MartynRank #285 · 8.8K reputationPosted Jul 9, 2015, 3:25 AM EDT
Davin MartynRank #285 · 8.8K reputationPosted Jul 9, 2015, 10:40 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 9, 2015, 10:56 PM EDT
Davin MartynRank #285 · 8.8K reputationPosted Jul 10, 2015, 2:31 AM EDT
Davin MartynRank #285 · 8.8K reputationPosted Jul 10, 2015, 2:33 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 10, 2015, 2:37 AM EDT
Davin MartynRank #285 · 8.8K reputationPosted Jul 10, 2015, 3:07 AM EDT
Davin MartynRank #285 · 8.8K reputationPosted Jul 11, 2015, 5:26 AM EDT