write from an html to another using JavaScript -
i have form written in html contains form. must write html page using javascript , contain information user writes in form.
<!doctype html> <html> <head> <script> function validateform() { var x=document.forms["myform"]["fname"].value; if (x==null || x=="") { alert("first name must filled out"); return false; } } </script> </head> <body> <form name="myform" action="demo_form.asp" onsubmit="return validateform()" method="post"> first name: <input type="text" name="fname"> <input type="submit" value="submit"> </form> </body>
have used appendchild
doesn't accept name of button.
if mean value form , show in popup why don't u try this..
check fiddle
<html> <script> function f() { var name = document.getelementbyid("name").value; var mywindow = window.open("","msgwindow","width=400,height=100"); mywindow.document.write("user name = <b><i>"+name+"</i></b>."); return false; } </script> <body> <form onsubmit="return f()" > <input type="text" id="name" /> <input type="submit" /> </form> </body> </html>
Comments
Post a Comment