How to place two forms on the same page?

You could make two forms with 2 different actions <form action=”login.php” method=”post”> <input type=”text” name=”user”> <input type=”password” name=”password”> <input type=”submit” value=”Login”> </form> <br /> <form action=”register.php” method=”post”> <input type=”text” name=”user”> <input type=”password” name=”password”> <input type=”submit” value=”Register”> </form> Or do this <form action=”doStuff.php” method=”post”> <input type=”text” name=”user”> <input type=”password” name=”password”> <input type=”hidden” name=”action” value=”login”> <input type=”submit” … Read more

Auto-Submit Form using JavaScript

You need to specify a frame, a target otherwise your script will vanish on first submit! Change document.myForm with document.forms[“myForm”]: <form name=”myForm” id=”myForm” target=”_myFrame” action=”test.php” method=”POST”> <p> <input name=”test” value=”test” /> </p> <p> <input type=”submit” value=”Submit” /> </p> </form> <script type=”text/javascript”> window.onload=function(){ var auto = setTimeout(function(){ autoRefresh(); }, 100); function submitform(){ alert(‘test’); document.forms[“myForm”].submit(); } function … Read more

How can I style a file input field in Firefox?

Many of the answers above are quite old. In 2013 a much simpler solution exists: nearly all current browsers… Chrome IE Safari Firefox with a few-line fix pass through click events from labels. Try it here: http://jsfiddle.net/rvCBX/7/ Style the <label> however you you would like your file upload to be. Set for=”someid” attribute on the … Read more

How to ajax-submit a form textarea input from CKEditor?

you need to first call the following, to make the CKEDITORs update their related fields.. for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); so HTML <a onClick=”CKupdate();$(‘#article-form’).ajaxSubmit();”>Submit</a> and javascript function CKupdate(){ for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); }

Best JavaScript solution for client-side form validation and interaction? [closed]

This is a shameless plug, but might I volunteer a framework that I designed? I’ve built it based on annotations (a la Hibernate Validator). It has support for custom constraints and I feel that it is pretty powerful. Here is also a Stackoverflow question where I asked for a review of the framework. Presentation: With … Read more