I'm using a simple javascript routing for button rollovers. The rollover images get preloaded:
image1 = new Image();
image1.src = "/images/image1blue.jpg";
And the buttons are implemented like this:
<a href="/index.php" onmouseover="image1.src='/images/image1blue_2x1.jpg';"...
I was just checking that a value was set for the button - my usual way of testing in submit has been pressed. I'm now checking something else in the POST variables.
I could have if I knew I needed to!
It seems to come as a surprise to anybody I've talked to so far that the submit button value doesn't get set on return press, only on clicking the submit button.
Turns out the problem is with the php component. If you use return key to submit a form
<input class="text" type="submit" name="submitBtn" value="Check domain"/>
then the php test
if (isset($_POST['submitBtn'])){
is false, but the test is true if you click the submit button. I fixed it by...
IE7 and Firefox.
At this point I am going to just strip it down and build it back up again. You've proven the core is good - I must be screwing up somewhere else. Thanks for the advice.
1DMF - thanks again for the help. You are not missing anything. I'm not yet concerned about validation.
I'm hitting enter after completing the text field, in the expectation that this will trigger a form submit, but that doesn't happen. It didn't happen without the javascript, so I added...
Thanks 1DMF.
Okay - the form is now declared as follows:
<form style="width: 345px" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="domain" name="domainform">
And my text field is like this:
Domain name: <input class="text" name="domainname" type="text" size="36"...
Thanks for your reply., but I guess it is the form submit code I am having problems with.
The current code is already processing the return key correctly. It is the myfield.form.submit() action which is the problem. The code is executed but the form does not seem to be submitted.
I found some javascript to force a submit action. It is invoked if the user completes a textbox in a form and hits the return key with the textbox in focus, rather than explicitly clicking the submit button.
I have an alert which proves that the javascript is running and hitting the block...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.