Ask a Question related to PHP Development, Design and Development.
-
Victor A. Cuya #1
$_POST behavior from input=submit vs input-type=button
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="thisisthetrigger" onclick="doThis(this.form)">but 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.
Victor A. Cuya Guest
-
input type="button"
Hi all, I have a flash form that contains an input type="button" with an onclick event that goes to an AS code. I need to be able to access the... -
Using Input Type Button to link to Frame Login. NeedHelp!!
Here is the working code and what I have that doesn't work. Please Help! Working: <td width="120" nowrap> <a... -
How to force submit on a specific INPUT TYPE object
I have a form with two or more INPUT TYPE (image, submit, button) objects, how can I force the ENTER event to act on a specific object and not to... -
input=text fires Submit when pressing Enter
Hello I have some textboxes (input type=Text) in a Form. In some Forms if I Press Enter while I am in the Textbox It causes a Submit. The... -
<button> instead of <input type=button>
Is there an option in dreamweaver MX to set this? I want to use the <button> tag instead of the <input> tag for my buttons because of the extra... -
S Austin #2
Re: $_POST behavior from input=submit vs input-type=button
use the input type=submit, move the button event to the form i.e., <form
onsubmit="doThis(this)"
Victor A. Cuya wrote:> 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="thisisthetrigger" onclick="doThis(this.form)">but 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.
>S Austin Guest
-
sma1king #3
Re: $_POST behavior from input=submit vs input-type=button
"Victor A. Cuya" <vcuya@mindspring.com> wrote in message
news:5mm1a01pbjccljape5j0j4qsp3bea64pl4@4ax.com...Dear Victor,> 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="thisisthetrigger" onclick="doThis(this.form)">but 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 think you may be stuck. Take a look at Alan Flavell's comments on this
issue in [url]http://ppewww.ph.gla.ac.uk/~flavell/www/trysub.html[/url]
George
sma1king Guest



Reply With Quote

