Solved

Make from action occur from button

Posted on 2000-05-18
3
228 Views
Last Modified: 2010-04-09
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
Comment
Question by:nhoj
3 Comments
 
LVL 3

Expert Comment

by:dplambert
ID: 2821253
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
 
LVL 1

Expert Comment

by:cbeattie
ID: 2821309
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
 
LVL 8

Accepted Solution

by:
xabi earned 100 total points
ID: 2821323
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question