Unstoppable Domains

Making an <input type="image" behave like an ordinary submit button

Spaceship Spaceship
Watch

PoorDoggie

Soon to be RICHdoggie!VIP Member
Impact
18
This is the code I have at the moment:
Code:
<input type="image" src="../images/trolley.gif" padding="0" name="submit" value="<?php echo $button[$count]; ?>" />

but instead of sending the value under the name "submit" it is sending the variables "submit_x" and "submit_y".

Is there any way of making it so that it will send a value when you click on it?

Thanks
Tom
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
Yes sure, actually you will use a standard button instead:
<input type="submit">

and using CSS you will tweak the button to use a background image (you can also set the button itself to transparent).
Look here for some examples: http://carpe.ambiprospect.com/buttons/formbuttons.htm
 
0
•••
@sdsinc
Thanks a lot for that link. Even I had the same difficulty.
 
0
•••
no... but the point is that it needs to have a value. By using a normal submit button the text is shown... and then it dosen't work. :(

It isn't that important I suppose, but it would be nice if an image could carry a value from a form.

I have a form that looks kinda like this:

Code:
<form method="post" action="thatpage.php">
<input name="firstname[<?php echo $count; ?>]" /><input name="lastname[<?php echo $count; ?>" /><input type="image" src="whatever.gif" value="<?php echo $count; ?>" /><br />
<input name="firstname[<?php echo $count; ?>]" /><input name="lastname[<?php echo $count; ?>" /><input type="image" src="whatever.gif" value="<?php echo $count; ?>" /><br />
<input name="firstname[<?php echo $count; ?>]" /><input name="lastname[<?php echo $count; ?>" /><input type="image" src="whatever.gif" value="<?php echo $count; ?>" /><br />
<input name="firstname[<?php echo $count; ?>]" /><input name="lastname[<?php echo $count; ?>" /><input type="image" src="whatever.gif" value="<?php echo $count; ?>" /><br />
<input name="firstname[<?php echo $count; ?>]" /><input name="lastname[<?php echo $count; ?>" /><input type="image" src="whatever.gif" value="<?php echo $count; ?>" /><br />
<input name="firstname[<?php echo $count; ?>]" /><input name="lastname[<?php echo $count; ?>" /><input type="image" src="whatever.gif" value="<?php echo $count; ?>" /><br />
<input name="firstname[<?php echo $count; ?>]" /><input name="lastname[<?php echo $count; ?>" /><input type="image" src="whatever.gif" value="<?php echo $count; ?>" /><br />
<input name="firstname[<?php echo $count; ?>]" /><input name="lastname[<?php echo $count; ?>" /><input type="image" src="whatever.gif" value="<?php echo $count; ?>" /><br />
</form>
and count is increased each time... so in the end it is this massive form... instead of little forms! :D... The submit button holds the value of the form the user is submitting at the time... and so I can get the right form values at the other end! lol... it needs to be an image though. :D

Thanks
Tom
 
0
•••
A hidden field within your form should do the trick I guess ?
 
0
•••
no sdsinc because it is all one big form, so EVERY hidden field will be sent.

Hey... the person I'm doing it for would rather have one big form, but I don't think it can be done? I will just make it into loads of little forms! :D
 
0
•••
You could just pass the variables through the URL. Otherwise, lots of little forms.
 
0
•••
<input type="submit" name="blabla" src="icon.png"/>

I think that works, and is the valid way. Its been awhile.

either type=submit or type=button would work i think
 
0
•••
Crath said:
<input type="submit" name="blabla" src="icon.png"/>

I think that works, and is the valid way. Its been awhile.

either type=submit or type=button would work i think
nope... tried it! lol

anyhow... lots of little forms it is! hehe thanks a lot everyone
 
0
•••
0
•••
I think he wants the whole image
 
0
•••
yea :) that wouldn't work because the text would still come after it! :(

Thansk though

I will just use loads of small forms! :D
 
0
•••
0
•••
0
•••
Appraise.net
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back