Jump to content

[SOLVED] $_GET submit image - stop posting mouse co-ords!


mattyvx

Recommended Posts

I have a small problem which i've eventually found out the cause for but im not sure how to resolve it.

 

Im using the below code which grabs a list of unique cities from my database and then places them into a drop down. When the drop down is submitted the url is set and directed to a table which uses the $GET variable "City" to display information for that city.

 

The problem is, because im using a image as a submit button its posting the mouse co-ordinates of the click along with the City variable so the output is something like

 

"./area/table.php?City=$city&.x=21&.y=74"

 

I only want the city variable to display but i want to keep my image submit button.... any ideas?

 

                <form action="../area/table.php" method="get">
                  <fieldset>
                    <h2><label for="town">Find Instructors in:</label></h2>
	<?php
                    include "scripts/citylist.php";
                    echo "<select name=\"City\" style=\"width:200px;height:25px;font-size:1em;\">";
                    while ($city = mysql_fetch_array($result)) 
                    {
                    echo "<option value=\"$city[0]\"> $city[0] </option>";
                    }
                    echo "</select>";
                    ?>
	<input  class="top10" type="image" src="images/searchnow.gif" />
                  </fieldset>
                </form>

 

p.s. we dont like using javascript  :P

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.