Forum Moderators: open
<input type="Submit" name="btn_submit" value="Submit">
but I want the word of "OK" displayed for the button instead of the word of submit, when visitor click on the button, the value of button to be pass is "submit" but not "OK". Can it be done? Any example?
as BlobFisk wrote, just start and change the value.
Most forms don't check this value.
However, if your form would do such a check (perhaps if the form has more than one SUBMIT button), then search in the form processing logic of the ACTION page for a
if ($_POST['btn_submit'] == "Submit") {...}
or similar and change it there into an "OK" accordingly.
Or create an own 'OKbutton.gif' showing an "OK" to the user instead of the underlying form's value="Submit", but this may not look good if you have other buttons as well in the form.
Regards,
R.
if ($btn_submit=="Submit"){
//submit process script here
}elseif ($btn_submit=="OK"){
//another process here
}
actually, both of this button (Submit, OK) are submit button but different submit process. In this case, value of both button can't be same else they will going for same process. So I'm thinking to make both button displayed as Submit but the value are different, with this they can work well in the if statement.
any ideas?
if ($btn_submit!=""){
//submit process script here
}elseif ($btn_ok!=""){
//another process here
}
If that won't work, or some other change to the PHP, all I can think of is maybe change the value using Javascript when the button's clicked?
<input type="button" name="btn_submit" value="OK" onclick="this.value='Submit';this.form.submit();">