View Full Version : simple button error I think?
I have a submit button like so:
<form action="http://www.volconvo.com/index.php?act=Search&f="> <input type='image' height=16 name='submit'
width=57 alt="advanced search" src="http://www.volconvo.com/advanced.gif" align='middle'
and it won't go to the link for some reason...it shouldn't be this hard heh..
01-15-2004, 06:44 PM
you seem to think that if you put an image into a <form> it will automatically act as a button, but it is not so. you just placed an image like any other image onto your web page. what you need to do is give your form a name and then add a onclick even to your image like this:
<form action="http://www.volconvo.com/index.php?act=Search&f=" name="my_form">
<input type='image' height=16 name='submit' width=57 alt="advanced search" src="http://www.volconvo.com/advanced.gif" align='middle' onclick="my_form.submit()" />
hmm..just tried that, and it didn't work...still takes me to a weird page: http://www.volconvo.com/index.php?submit.x=36&submit.y=11
01-15-2004, 09:00 PM
According to the spec (http://www.w3.org/TR/html4/interact/forms.html#h-17.4.1), DoubleV is quite plainly wrong. It is true, Ceen, if you had used an <img> tag, you'd need an onclick event trigger. With an <input type="image"> you should be fine.
Do you have a demo page? I'm willing to bet the issue is your form's method crossing wires with the query-string variables in the form's action. Try method="post", or failing that, move the "?act=Search&f=" into two hidden inputs (name="act" value="Search"><input name="f"). That might do the trick.
01-15-2004, 09:30 PM
I don't see your image-input for a search.
Can you work up a small demo and see if you can localize the issue?
01-15-2004, 11:00 PM
Originally posted by Choopernickel
It is true, Ceen, if you had used an <img> tag, you'd need an onclick event trigger. With an <input type="image"> you should be fine.
I was answering in a hurry and the fact that CeeN used <input type="image"> and not an <img> tag had completely bypassed me. :o
hmm..so how should I do this :( I have no idea what to do now lol
01-15-2004, 11:27 PM
what is the point of having a form with only an image as input?
couldn't you then just as well have an image tag surround by an anchor tag?
no, for some reason it doesn't line up that way with the other image...wow I didn't think it would be this hard heh
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.