Reply
invisible submit button
Old 03-19-2008, 04:32 PM invisible submit button
Novice Talker

Posts: 5
Name: David van der Tuijn
Hi,

I would like to submit a form with an invisible submit button,

And use the 'RETURN' button on the keyboard to submit the form.

However this does not work when using multiple input fields within Internet Explorer.

PHP Code:
<?PHP
print_r 
($_POST);
?>
HTML Code:
<h1>Does NOT work in Internet Explorer:</h1>
<form action="index.php" method="post">
 <input type="text" name="naam" />
 <input type="text" name="achternaam" />
 <input type="submit" name="submit" style="visibility: hidden" />
</form>
<hr />
<form action="index.php" method="post">
 <input type="text" name="straat" />
 <input type="text" name="huisnummer" />
 <input type="submit" name="submit" style="display: none" />
</form>
<h1>Does work in Internet Explorer:</h1>
<form action="index.php" method="post">
 <input type="text" name="naam" />
 <input type="submit" name="submit" style="visibility: hidden" />
</form>
<hr />
<form action="index.php" method="post">
 <input type="text" name="straat" />
 <input type="submit" name="submit" style="display: none" />
</form>
Any suggestions would be great!
TFaLCoN is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 03-19-2008, 05:14 PM Re: invisible submit button
LadynRed's Avatar
Super Moderator

Posts: 6,539
Location: Tennessee
You really shouldn't do that, it flies in the face of accessibility.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-19-2008, 05:17 PM Re: invisible submit button
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
I second that opinion. always have a submit button accesable by the user, much, much easier.
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 03-19-2008, 06:01 PM Re: invisible submit button
Novice Talker

Posts: 5
Name: David van der Tuijn
But is it possible, with JavaScript?
TFaLCoN is offline
Reply With Quote
View Public Profile
 
Old 03-19-2008, 06:24 PM Re: invisible submit button
Average Talker

Posts: 16
Name: andy
you could have an onkeydown function on the second input passing the event, which checks which key was pressed - if enter submit form
__________________
Web Design Bournemouth
womble is offline
Reply With Quote
View Public Profile
 
Old 03-20-2008, 02:27 AM Re: invisible submit button
Novice Talker

Posts: 5
Name: David van der Tuijn
HTML Code:
<input type="text" name="huisnummer" onKeyDown="if (window.event.keyCode==13) this.form.submit();" />
Almost there... why does it not work?!?
TFaLCoN is offline
Reply With Quote
View Public Profile
 
Old 03-20-2008, 08:29 AM Re: invisible submit button
Banned

Posts: 4
Name: alper
you can do with javascript
emengen3 is offline
Reply With Quote
View Public Profile
 
Old 03-20-2008, 04:59 PM Re: invisible submit button
Novice Talker

Posts: 5
Name: David van der Tuijn
Please explain how...

TFaLCoN is offline
Reply With Quote
View Public Profile
 
Old 03-23-2008, 09:17 AM Re: invisible submit button
Novice Talker

Posts: 5
Name: David van der Tuijn
SOLVED!

Do not name your submit button 'submit'. Internet Explorer !@#$
TFaLCoN is offline
Reply With Quote
View Public Profile
 
Old 03-24-2008, 07:04 PM Re: invisible submit button
QiSoftware's Avatar
Skilled Talker

Posts: 62
Location: U.S.
use a 1x1 clear graphic as the submit button.

Q...
QiSoftware is offline
Reply With Quote
View Public Profile Visit QiSoftware's homepage!
 
Old 03-24-2008, 09:44 PM Re: invisible submit button
Average Talker

Posts: 22
Name: Jeremy Smith
and that's why we're glad to see ff on the rise...
thewebdude76 is offline
Reply With Quote
View Public Profile Visit thewebdude76's homepage!
 
Reply     « Reply to invisible submit button
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15450 seconds with 12 queries