Solved

Make from action occur from button

Posted on 2000-05-18
3
217 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now