LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-17-2007, 05:26 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
javascript: enter key handling with multiple submit buttons?


I have a dynamically generated (html) table that looks like this:

thing thing thing <submit button1>
thing thing thing <submit button2>
field field field <submit button3>

where "things" are text that's pulled from the db
button1 & button2 are "edit" buttons that will activate a row for editing.
button3 is a "save" button that will save a new row from user input. The number of rows/columns varies greatly depending on context.

I would like to be able to hit the Enter key & the correct button be clicked. The "correct" button is the one that's in the same row as the text that's being edited.

Does anyone know of a slick method of doing this? Hell, I'd even take a cumbersome method at the moment. I know how to look for a key event on a single field & have it click a single submit button, but how do you handle multiple fields & multiple buttons?
 
Old 09-18-2007, 01:51 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
so every row is a separate form? if not try out...
 
Old 09-18-2007, 12:50 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by j-ray View Post
so every row is a separate form? if not try out...
nope. Trying to stay away from hundreds of forms - they really seem to mess with spacing not to mention cluttering up the code.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript - submit an iframe form AM1SHFURN1TURE Programming 1 09-23-2006 05:51 PM
handling windowclose event in javascript sajith Programming 1 03-25-2006 06:41 PM
javascript: change value of text field and submit codec Programming 3 06-06-2005 08:08 AM
submit a form with javascript djgerbavore Programming 6 06-01-2005 02:46 PM
Perl Cgi - Multiple Submit Buttons michedlp Programming 7 03-11-2004 03:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration