Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List onclick submit 1

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
0
0
GB
I am trying to find an alternative way to submit a form when a listrow is clicked, instead of the user clicking the list and then a submit button. Code below is what I have at the moment, excluding the submit button code. Thanks

echo '<select name="Barcode" size="15" style="width:150px;">';

while($nt=mysql_fetch_array($result)) { // Array or records stored in nt

echo '<option value="'.$nt[Barcode].'">' .$nt['Barcode'].'</option>';
}
echo '</select>'; // closing list

?>
 
It would be very helpful in the future if you post your client-side script (the HTML produced within the browser) instead of your server-side code.

That being said, try this:

Code:
echo '<select name="Barcode" size="15" style="width:150px;" [red][b]onchange="this.form.submit();"[/b][/red]>';

----
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top