Click to See Complete Forum and Search --> : [RESOLVED] HTML - Problem with Form submit
Master Zen
05-15-2007, 01:37 PM
I'm using this form field:
<form name="form" method="get" action="search.php">
Search:<br />
<input type="text" name="search" size="20" class="searchbox">
<input type="image" name="submit" src="images/icon_search.gif" class="searchbox">
</form>
However, I get the submit values in the URL too.
Ex:
search.php?search=testing&submit.x=0&submit.y=0
I only want "search=testing" to appear. How can I do this? Thanks.
Protato
05-15-2007, 03:49 PM
Include the image in <img> tags rather then <input>, and use a small bit of javascript to submit the form (form must have an id). Since you are using the get method, all form elements show up in the query string. If you absolutely need the submit button to not show up in the query string, you have to use javascript or the post method.
<form id="form_1" action="" method="get">
<input name="test" type="text" />
<img src="img.jpg" width="25" height="25" onclick="document.getElementById('form_1').submit()" />
</form>
Weedpacket
05-15-2007, 05:57 PM
Include the image in <img> tags rather then <input>, and use a small bit of javascript to submit the form (form must have an id).Or use an ordinary submit button and a stylesheet to specify its size and background image and border and stuff like that.
Master Zen
05-15-2007, 06:02 PM
Actually that's exactly what I did and it worked. Thanks both :)
Protato
05-15-2007, 06:16 PM
Or use an ordinary submit button and a stylesheet to specify its size and background image and border and stuff like that.
Duh! Don't know how I overlooked that one.
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.