[SOLVED] Restricting the X and Y from Image Submit buttons..
Moderator: General Moderators
[SOLVED] Restricting the X and Y from Image Submit buttons..
Well, maybe this isn't that easy but anyways...
http://www.bolt3.com/systems.php
This is part of my site I'm working on. Go to this page and use my system drop down menu to pick a system and hit the go button.
In the URL bar, it passes the systemID and then the variables for the go button aswell. Thing is I do not want the variables from the submit button to be passed (&Submit.x=3&Submit.y=11).
I just want users to see http://www.bolt3.com/systems.php?systemID=15 (an example)....
So is there a way to get rid of the submit button junk it's passing? I want to leave my urls as clean as can be for now so when I install the mod_rewrite it wont be all wierd.
Thanks guys.
http://www.bolt3.com/systems.php
This is part of my site I'm working on. Go to this page and use my system drop down menu to pick a system and hit the go button.
In the URL bar, it passes the systemID and then the variables for the go button aswell. Thing is I do not want the variables from the submit button to be passed (&Submit.x=3&Submit.y=11).
I just want users to see http://www.bolt3.com/systems.php?systemID=15 (an example)....
So is there a way to get rid of the submit button junk it's passing? I want to leave my urls as clean as can be for now so when I install the mod_rewrite it wont be all wierd.
Thanks guys.
Last edited by jonas on Thu Jun 10, 2004 2:31 pm, edited 1 time in total.
http://www.bolt3.com/systems.php?systemID=4&x=13&y=7
So now we get x and y ...
I suppose this is because it is an image submit button over a regular browser submit button?
So now we get x and y ...
I suppose this is because it is an image submit button over a regular browser submit button?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
okay.. since that's not quite right.. Try this:
Code: Select all
<script language="Javascript"><!--
function buildSearch(go)
{
document.location.href = go;
return false;
}
//--></script>
--------
<form name="whatever" onsubmit="buildSearch(this.systemID.optionsїthis.systemID.selectedIndex].value)"><select name="systemID" onchange="buildSearch(this.optionsїthis.selectedIndex].value)">
<option>---------</option>
<option value="http://someurl.com">some option</option>
</select><input type="image" src="someimage.gif"></form>I don't think I'm doing this right.....
I just noticed that my search bar to the left also submits (even though it goes to no where currently) the x and y values of the image submit.
I notice a lot of big sites use the same method of passing variables as I do but they don't have the x and y values pass.(rottentomatoes.com)
Code: Select all
<script language="Javascript"><!--
function buildSearch(go)
{
document.location.href = go;
return false;
}
//--></script>
<form onsubmit="buildSearch(this.systemID.optionsїthis.systemID.selectedIndex].value)" method="GET">
<tr>
<td><select name="system_ID" class="headerform" onchange="buildSearch(this.optionsїthis.selectedIndex].value)">
<option value="" selected>Pick a System</option>");
$query = "SELECT * FROM systems";
$mysql_stuff = mysql_query($query, $mysql_link);
while($roc = mysql_fetch_row($mysql_stuff)){
$system_ID = $rocї0];
$system_name = $rocї1];
print("<option value="http://www.bolt3.com/systems.php">$system_name</option>");
}
print("</select></td>
<td valign="middle"><input type="image" src="http://www.bolt3.com/siteimages/gobutton.gif"></td>I notice a lot of big sites use the same method of passing variables as I do but they don't have the x and y values pass.(rottentomatoes.com)