"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

Go Back   Webmaster Forums > Code Forum > HTML Forum

Reply
 
Thread Tools Rate this Webmaster Discussion
Old 10-08-2003, 07:24 AM   #1
Zamees
New Member
 
Join Date: Sep 2003
Webmaster Discussions: 19
Rep Power: 43
Zamees is on a distinguished road
input type= image vs. submit

It appears when i set the input type to submit, the code works fine, but when i change it to image, just reloads the same page without submitting the info. how come?


Code:
<form method=post action="<%= Request.ServerVariables("SCRIPT_NAME") %>" name=login>

<input TYPE="submit" Name="action" value="login" src=login.jpg TABINDEX=3></td>      *GOOD*

<input TYPE="image" Name="action" value="login" src=login.jpg TABINDEX=3></td>     *NO GOOD*
            </form>


Zamees is offline   Reply With Quote
Old 10-08-2003, 08:31 AM   #2
HTML
Administrator
 
HTML's Avatar
 
Join Date: Aug 2000
Location: San Antonio
Webmaster Discussions: 3,296
Rep Power: 50
HTML has a reputation beyond reputeHTML has a reputation beyond reputeHTML has a reputation beyond reputeHTML has a reputation beyond reputeHTML has a reputation beyond reputeHTML has a reputation beyond reputeHTML has a reputation beyond repute
I see no reason why it does not work, do you have a page that I can look at?

Dave
HTML is offline   Reply With Quote
Old 10-08-2003, 11:50 AM   #3
QuietDean
Administrator
 
QuietDean's Avatar
 
Join Date: Oct 2000
Location: Bournemouth, UK
Webmaster Discussions: 2,662
Rep Power: 97
QuietDean has a reputation beyond reputeQuietDean has a reputation beyond reputeQuietDean has a reputation beyond reputeQuietDean has a reputation beyond reputeQuietDean has a reputation beyond reputeQuietDean has a reputation beyond reputeQuietDean has a reputation beyond reputeQuietDean has a reputation beyond reputeQuietDean has a reputation beyond repute
Send a message via ICQ to QuietDean
The problem is 'probably' in the code that the form is submitted to, not the code itself. Try making the 'name' if the image input the same as the 'name' of the submit button.
__________________
If one of our members helps you, please click the icon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
QuietDean is offline   Reply With Quote
Old 12-19-2003, 10:05 PM   #4
TurtleMan
New Member
 
Join Date: Dec 2003
Webmaster Discussions: 5
Rep Power: 41
TurtleMan is on a distinguished road
Having the same problem

Quote:
Originally Posted by QuietDean
The problem is 'probably' in the code that the form is submitted to, not the code itself. Try making the 'name' if the image input the same as the 'name' of the submit button.
<B>Works:</B>
<INPUT type=submit name=add value=\"Add User\">

<B>Does not work:</B>
<INPUT TYPE=image name=add SRC=images/buttons/add.jpg ALT=add VALUE=add>

The form is submitting to itself and I have PHP that reads through the submitted data:
if ( $this->rdata['add'] )
$this->add_user_form();


Once again, the submit button works fine, the image button does submit the 'name' to the form. Help?

Thanks!
TurtleMan is offline   Reply With Quote
Old 12-20-2003, 02:01 AM   #5
TurtleMan
New Member
 
Join Date: Dec 2003
Webmaster Discussions: 5
Rep Power: 41
TurtleMan is on a distinguished road
ok, I found out what was going on.

When it's just the submit button named add... it submits to the form with the value "add"....

When it's the image... it submits to the form with the value "add_x". There is also a value for "add_y" which these values correspond to the x and y position of the mouse where you click on the picture.

cheers
TurtleMan is offline   Reply With Quote
Old 10-06-2009, 04:28 AM   #6
sbl
New Member
 
Join Date: Oct 2009
Location: Dhaka, Bangladesh
Webmaster Discussions: 2
Rep Power: 6
sbl is on a distinguished road
Wink Re: input type= image vs. submit

Dear Zamees, You can use inline css here just like that...

Code:
<form method=post action="<%= Request.ServerVariables("SCRIPT_NAME") %>" name=login>

<input TYPE="submit" Name="action" value="login" src=login.jpg TABINDEX=3></td>      *GOOD*

<input TYPE="submit" Name="action" value="login" style="background:url(login.jpg); width:30px; height:30px;" TABINDEX=3></td>     *ALSO GOOD*
            </form>

Last edited by sbl; 10-06-2009 at 04:31 AM.
sbl is offline   Reply With Quote
Reply

Bookmarks

Tags
image, input, submit, type

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Webmaster Discussions
Thread Webmaster Discussion Starter Forum Replies Last Post
enable and disable the submit button with respect to radio button input zzz PHP Forum 3 01-30-2009 04:32 AM
input type=hidden name="to" VALUE="user@yahoo.com" hbass HTML Forum 1 06-08-2006 04:10 PM
Submit with Image tag that sends its own value gohatesusall HTML Forum 9 11-11-2002 12:03 AM
Form input type tbird HTML Forum 1 12-11-2000 07:37 PM
How do I type beside a cell allstarr HTML Forum 10 10-28-2000 07:32 PM


All times are GMT -5. The time now is 08:58 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.