Hi . Very new to all this. I have the following form:
- <form id="name="UpdateStatus" action="" method="post">
- <select>
-
- <option value="1">Defcon Green</option>
- <option value="2">Defcon Amber</option>
-
- </select>
-
- <p><input type="radio" name="StatusMessage" value="default" checked>Default Status</input>
- <input type="radio" name="StatusMessage" value="last">Last Status</input></p>
-
- <textarea rows="5" cols="70" name="status"></textarea>
-
- <p><input type="submit" name="submit" value="Update" /></p>
- </form>
I want to use jQuery so that when the user changes
either the select
or the radio buttons, it sends both variables to a php script, which looks them up in a database and populates the textarea with the appropriate text.
I have the PHP and the MYSQL, but what I would like help with is:
- Is it possible to have an onchange for either control, or do I have to duplicate it?
- How do I send the form data to a PHP script with onchange?
- In the PHP script, how do I get the variables?
- When the PHP script returns the text, how do I access the result from JQuery?
Any help would be really appreciated.
Thanks
Chris