Click to See Complete Forum and Search --> : Jumping to anchor tags
kevin.m.clarke
07-15-2003, 09:59 AM
I am trying to submit some datails, but when the form is reloaded, it does not return to where it left off.
I have set up some anchor tags, and have even hard coded the #30 to the end of the action=orderform.php so that it should jump to this line every time but it is not working.
What does orderform.php look like? Is it just a form processor that sends you somewhere else when it is done (ie. back to the form, etc)?
kevin.m.clarke
07-15-2003, 10:17 AM
orderform.php is the form itself, so it is just refreshing itself.
Can we see some code, please...
kevin.m.clarke
07-15-2003, 10:35 AM
OK. Here is the beginning and end of the code. The stuff in between is just replicas from 2 to 29.
echo "<form name='addlines' action='orderform.php#30' method='post' target='addline'>
<table width='65%' border='2'>
<tr><td width='20'><b>No.</td><td width='230'>Part number</td><td width='80'>Qty</td><td>Description</td>
</tr>
<tr><td>1</td><td><input type='text' name='partno1' size='30' maxlength='20' value='$_POST[partno1]' onfocus='<a name=1>' onblur='document.addlines.submit()'>";
$query1 = mysql_query ("SELECT * FROM parts WHERE partno like '$_POST[partno1]'");
$row1 = mysql_fetch_row($query1);
echo "</td>
<td><input type='text' name='qty1' size='10' value='$_POST[qty1]'></td>
<td>$row1[1]</td></tr>
etc.
etc.
etc.
<a name='30'><tr><td>30</td><td><input type='text' name='partno30' size='30' maxlength='20' value='$_POST[partno30]' onblur='document.addlines.submit()'>";
$query30 = mysql_query ("SELECT * FROM parts WHERE partno like '$_POST[partno30]'");
$row30 = mysql_fetch_row($query30);
echo "</td>
<td><input type='text' name='qty30' size='10' value='$_POST[qty30]'></td>
<td>$row30[1]</td></tr>
This isn't going to work:
onfocus='<a name=1>'
try putting <a name=1> before the <input> tag...