Wondering if we can do this
Posted: Fri Nov 21, 2008 1:00 pm
Greetings:
I have a PHP page that I am working on that has multiple forms on one page. (I am open to another way of doing this if we can find it).
The first form queries the database and dynamically creates a dropdown of possible people to select from (this form's action is PHP_SELF).
Now the second form is poplulated from another table in the database and has it's own submit button which launches a "processing page" to update or create a row in the database. The default "mode" of the form should be UPDATE with an option to change the "mode" to ADD on the fly.
If I have successfully described the page, then the question is how can I change the variable (in this case I named it $formState) to "0" which is my flag for "Add". It needs to default to "1" unless a button or link is selected and that link should change the $formState variable to "Add" (0) from "Update" (1)... the trick has been trying to make this button (or href) work and I would prefer NOT to use JavaScript to do it, but I will if that is the easiest way. BTW: I don't want to reload the page to do this.
Please advise if you would like to see the code for the page as it stands.
Thanks,
Mike
I have a PHP page that I am working on that has multiple forms on one page. (I am open to another way of doing this if we can find it).
The first form queries the database and dynamically creates a dropdown of possible people to select from (this form's action is PHP_SELF).
Now the second form is poplulated from another table in the database and has it's own submit button which launches a "processing page" to update or create a row in the database. The default "mode" of the form should be UPDATE with an option to change the "mode" to ADD on the fly.
If I have successfully described the page, then the question is how can I change the variable (in this case I named it $formState) to "0" which is my flag for "Add". It needs to default to "1" unless a button or link is selected and that link should change the $formState variable to "Add" (0) from "Update" (1)... the trick has been trying to make this button (or href) work and I would prefer NOT to use JavaScript to do it, but I will if that is the easiest way. BTW: I don't want to reload the page to do this.
Please advise if you would like to see the code for the page as it stands.
Thanks,
Mike