Hello all,
I have been trying to solve an annoying behavior with PHP (I think).
Maybe some of you have encountered the same and have some ideas.
I have an html form and I use an <input type="button"> element with
the onClick event that calls a javascript funtion. Once the script's
content has been processed, I execute the form.submit() directive.
I would like to combine the html form and the PHP script into one, and
use action="<?php echo($PHP_SELF) ?>".
When the html form has <input type="button" name="theButton "
value="thisisth etrigger" onclick="doThis (this.form)">bu t PHP cannot
'read' the value of $_POST["theButton"] after form.submit().
If I substitute the <input type="button"> for <input type="submit">
then PHP reads the value just fine. Some may argue to just use the
latter option, but that will cost me a trip back to the server to
basically do a lot of validation that can be very easily accomplished
on the client side.
Any suggestions will be greatly appreciated.
I have been trying to solve an annoying behavior with PHP (I think).
Maybe some of you have encountered the same and have some ideas.
I have an html form and I use an <input type="button"> element with
the onClick event that calls a javascript funtion. Once the script's
content has been processed, I execute the form.submit() directive.
I would like to combine the html form and the PHP script into one, and
use action="<?php echo($PHP_SELF) ?>".
When the html form has <input type="button" name="theButton "
value="thisisth etrigger" onclick="doThis (this.form)">bu t PHP cannot
'read' the value of $_POST["theButton"] after form.submit().
If I substitute the <input type="button"> for <input type="submit">
then PHP reads the value just fine. Some may argue to just use the
latter option, but that will cost me a trip back to the server to
basically do a lot of validation that can be very easily accomplished
on the client side.
Any suggestions will be greatly appreciated.
Comment