I have a form with a text field where some text is entered and is sent across using the GET method. But instead of a traditional submit button I'm using an image and I want that to do the function of the submit button.

A simple <a href="file.php"><img src="image"></img></a> can make the image link to the next page but the value is obviously not sent with it (which im trying to send with GET method)

How do I do this?

Recommended Answers

All 3 Replies

i made a working example for you...

<form method="get" action="example.php" name="myform" id="myform">
<input type="text">
<input type="submit" id="go" name="go" style="display: none">
<img src="http://s.ytimg.com/yt/favicon-vflZlzSbU.ico" onClick="go.click()"></img>
</form>

Nice and simple. Thanks!

Or you could use CSS to apply your image as the submit button

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.