• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Make from action occur from button

I have table within a form. In the last column of the table I have a radio button for each row, each associated with a value for that row. When the user clicks a radio button and then presses the submit button then next page is generated from the database. This works, however the table often has many screens of data and if the selected item is near the bottom of the table the user must then scroll to the top to press the submit button. Inconvenient !
What I would like to do is replace the radio button with an ordinary button that will execute the action normally associated with the submit button. I can then have one button per row of the table.

Thanks
0
nhoj
Asked:
nhoj
1 Solution
 
dplambertCommented:
I assume that by clicking on the radio button for a given row, it passes an identifier for the row to the next page, like rowID.

One thing you can do is simply use a link to call the page, but you specify the rowID in the URL for each row:

<a href="detailed_data.cgi?rowID=123">Detail</a>

The next row would be:

<a href="detailed_data.cgi?rowID=124">Detail</a>

Obviously, the you would print this out using your CGI program. This is a quick HTML solution. You can access that rowID in your CGI program for detailed_data.cgi.
0
 
cbeattieCommented:
Why not just put another submit button at the bottom of the page.  You can have multiple sumbit buttons.  Or just put one by each radio button.  There is a way to make the radio button selection trigger a submit, but it involves a javascript and I do not know the details of how to implement it.
0
 
xabiCommented:
Just change your radio button into this
<input type="button" onclick="this.form.buttonpressed.value='what_you_want';this.form.submit()">

and add this field inside the form:
<input type="hidden" name="buttonpressed">

xabi
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now