Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Ronald Raygun
May 7, 2008, 10:43 pm
rate this thread
several forms contained in divs, which are hidden/made visible,
depending on the wizard step. Each form has an action parameter set to a
different php script, which is responsible for returning a true/false (+
mesage back to the form.
So I have something like this:
<div id = "page1"><form onaction = "step1.php"
<div id = "page2"><form onaction = "step2.php"
I know how to set the onclick event of the button in a form to a
the data to the server. However, this is what I want to do (in
//Send form input data to php server script
//get server response from php script and display in alert box
I don't know if its possible to cause a php script to be run by
"calling" it from JS (ala RPC), but basically, what I want to do is:
a). Validata user input clientside, using JS (easy bit)
b). Cause the form to invoke its action method (How?)
c). Receive server response in JS and display in alert box (HOW?)
By gathering the values in the current form and submitting it in a
XMLHTTPRequest (with possibly slightly altered GET url to indicate JS
validation), and awating it in the repomse.
By interpreting the result from the request amd putting it in an alert box.
For more AJAX questions, I'd advise asking questions in
output either text, JSON or XML format with PHP for the calling JS script,
whichever strikes your fancy.
on 05/07/2008 07:43 PM Ronald Raygun said the following:
Yes, you can do that with some AJAX techniques.
You may want to try this forms generation and validation class that
comes with a plug-in that supports AJAX form submission.
The plug-in lets you submit the form without page reloading and have the
PHP on the server respond with several types of actions like generating
display alert message, updating parts of the page, or execute any
Here you may watch a tutorial video:
PHP professionals looking for PHP jobs
PHP Classes - Free ready to use OOP components written in PHP
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum