Craig82
09-19-2009, 07:44 AM
Hi,
I'm new here so hope you don't mind me asking for some help. :confused:
I have a jump box function that worked great when I had a submit button. Now I changed the submit button to an image type and it seems to have broken.
Here is the code, I put "area" as an option value for easier reading as I have PHP code in the original:
Example
<script type="text/javascript">
function LinkUp()
{
var number = document.jump.user_site.selectedIndex;
location.href = document.jump.user_site.options[number].value;
}
</script>
<form name="jump" action="">
<p>
<select name="user_site">
<option value="index.php" selected>Jump to...</option>
<option value="index.php#area1">Area 1</option>
<option value="index.php#area2">Area 2</option>
</select>
<input type="image" src="../images/input.png" style="border:0;width:24px;height:24px;background-color:transparent;padding:0;margin-bottom:-0.6em" alt="Go" name="Go" title="Go" onClick="LinkUp()">
</form>
With a submit button it would jump to the correct area (in this case website links). Now with an image submit it doesn't jump and simply puts this in the browser URL when clicked:
http//www.example.com/?user_site=index.php%3Fpage%3D1%26sort%3D%23area1&x=15&y=15
In that URL please ignore: page and sort. These are from the option value for PHP to display the page correctly.
Any ideas why? Any help is appreciated!
Craig.
I'm new here so hope you don't mind me asking for some help. :confused:
I have a jump box function that worked great when I had a submit button. Now I changed the submit button to an image type and it seems to have broken.
Here is the code, I put "area" as an option value for easier reading as I have PHP code in the original:
Example
<script type="text/javascript">
function LinkUp()
{
var number = document.jump.user_site.selectedIndex;
location.href = document.jump.user_site.options[number].value;
}
</script>
<form name="jump" action="">
<p>
<select name="user_site">
<option value="index.php" selected>Jump to...</option>
<option value="index.php#area1">Area 1</option>
<option value="index.php#area2">Area 2</option>
</select>
<input type="image" src="../images/input.png" style="border:0;width:24px;height:24px;background-color:transparent;padding:0;margin-bottom:-0.6em" alt="Go" name="Go" title="Go" onClick="LinkUp()">
</form>
With a submit button it would jump to the correct area (in this case website links). Now with an image submit it doesn't jump and simply puts this in the browser URL when clicked:
http//www.example.com/?user_site=index.php%3Fpage%3D1%26sort%3D%23area1&x=15&y=15
In that URL please ignore: page and sort. These are from the option value for PHP to display the page correctly.
Any ideas why? Any help is appreciated!
Craig.