简体   繁体   中英

Using javascript: how to create an alert window to display submitted form values?

I appreciate the javascript helpe. I amn new to . this software as well and am loving your guy's feedback!!

Below link example is give you idea how to submit from with JavaScript validation.

https://www.w3schools.com/js/js_validation.asp

let me know you still facing any issue.

 <html> <head> </head> <body> <form name="myForm"> Name: <input type="text" Id="fname" name="fname"> <br> Second Name: <input type="text" Id="sname" name="fname"> <br> <input type="submit" onClick="return alertdisplay()" value="Submit"> </form> </body> </html> <script> function alertdisplay(){ var fn = document.getElementById('fname').value; alert(fn); var sn = document.getElementById('sname').value; alert('Fisr Name : ' + fn + ' Secodnd Name : ' + sn); } </script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM