cmxads.com banner logo

 

Posting data with javascript example tutorial. This example includes posting using ajax and posting to a hidden Iframe using form target and displaying a confirm message in another division. Both methods are included see the source code. Posting to an Iframe is the same as using ajax. But you can post the same data to multiple targets if needed using a custom function with multiple targets and submits one at a time.
The post to target method it is set for now. we are just var dumping the post to script return in the Iframe. Inpractice the Ifame is styled to 0px size and we set a getelementbyID message to a division. The source code has the examples commented out. Use as needed.

When using an input validation function with your form make sure a post method is set (or a conflict will ensue)and the function validates the input then posts the form. HTML5 and javascript validation is used here.

Please Log in