@NogDogJun 21.2006 — #I think the only way PHP could know is if the button had an onclick JavaScript event associated with it that did something like changing the value of the button (or perhaps some hidden form element?). But then you're depending upon the client to do some of your work, which is never 100% dependable.
Perhaps if you explain what the purpose is of using an <input type="button"> element in your form, we could suggest an alternative? (For instance, maybe all you need to do is use a <button type="submit"> element, instead.)
@MonsieurRenardauthorJun 21.2006 — #Well the thing is I want to call a javascript to do AJAX stuff when the button is pressed (submit would refresh the page). The script sends a request to another php page which uses registered variables from the current page to do stuff. One of those variables is an array $answers, but it needs to be updated when the button is pressed before the javascript sends a request to the other page, and I think only PHP could update it.
I don't know if I'm making any sense, but I greatly appreciate your help.
PS: The main reason I'm having these problems is because I'm using someone else's PHP code and making it work with AJAX without changing the php too much.
@chazzyJun 21.2006 — #are you using get or post to send the data? where is answers being stored? typically you can't send an "array" over HTTP - because browsers dont really know what that is.
@felgallJun 21.2006 — #All of the fields in the form are sent to the next page in either the $_GET or $_POST variables when the form is submitted with the following exceptions:
Any disabled fields are not sent
Only selected checkboxes and radio buttons are sent