473,785 Members | 3,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Radio Submit Button Problem

JR
Hi. I hope someone out there who is more versed with JavaScript than
I can help me with the following annoying problem. Here's the
problem.

I have a form with the following layout:

Column A Column B Column C
data 4 radio buttons more data
.... ... ...
.... ... ...

The form does have a submit button that leads to a given CGI script.
The form also has submit buttons as onClick events inside of the radio
buttons, that point to a different CGI script. The problem is that I
need to know which particular radio button triggered the onClick
event, because when I receive the form data, I only want to process
the row of data for which an event was triggered. As the script is
now, I just receive everything from the form, without knowing which
row to actually process. The one thing I thought about trying was to
call a function with the onClick event that would receive a given row
id (1 through up to 279), and the use document.write to create a
hidden value for just that id. I don't know if this is workable,
though. Am I on the right track with this idea? Is this doable, or
should I think about trying a different approach?

Thanks!!!
Jul 23 '05
15 2559
Steven Daedelus wrote:
In article <40************ **@PointedEars. de>,
Thomas 'PointedEars' Lahn <Po*********@nu rfuerspam.de> wrote:


Please do not write attribution novels, see e.g.
<http://www.holgermetzg er.de/netscape/usenet.html>
<http://netmeister.org/news/learn2quote.htm l>
JR wrote:
> The form does have a submit button that leads to a given CGI script.
> The form also has submit buttons as onClick events inside of the radio
> buttons, that point to a different CGI script.


What about users without support for client-side scripting?


You can please all the people some of the time, and some of the people
all the time, but you can't please all the people all the time.


But you can do easily here.
PointedEars
Jul 23 '05 #11
Steven Daedelus wrote:
Do you ever get the feeling that a lot of the most severe compliance ^^^^^^^^^^ fascists don't have clients?

^^^^^^^^
Godwin's Law. You lose.
PointedEars, F'up2 where it belongs
Jul 23 '05 #12
JR
ca*********@hot mail.com (Kien) wrote in message news:<16******* *************** ****@posting.go ogle.com>...
</script>

Maybe crude and very redundant but it's 7AM and my brain is not
working ...

HTH

Kien


If it's crude and redundant, but works, I'm all for it! Thanks very
much for the solution. I found that the best solution for my
particular problem was right along the lines of your script. I call a
given function when the user selects a certain radio button, and pass
to this function data for only the row I want to process. I then
append this data string to my script path, i.e.
path/program.cgi?jav ascript_params, and then submit the form. This
way, I do get all of the data from the form when it is submitted, but
I know which row of data to process in the receiving script.

Thanks to everyone for the suggestions.

JR
Jul 23 '05 #13
JRS: In article <40************ @PointedEars.de >, seen in
news:comp.lang. javascript, Thomas 'PointedEars' Lahn
<Po*********@nu rfuerspam.de> posted at Wed, 2 Jun 2004 01:54:48 :
Steven Daedelus wrote:
In article <40************ **@PointedEars. de>,
Thomas 'PointedEars' Lahn <Po*********@nu rfuerspam.de> wrote:


Please do not write attribution novels, see e.g.
<http://www.holgermetzg er.de/netscape/usenet.html>
<http://netmeister.org/news/learn2quote.htm l>


Son-of-RFC1036 (1994) refers to "attributio n lines" containing more
than just a name. Note the implication that more than one physical line
may be
needed.

A draft RFC by C H Lindsey (a well-known News expert), dated August
2002, envisages a line containing name, E-address, newsgroup, Message-
ID, date, and time; and that it may be folded. It is called draft-ietf-
usefor-article-08.txt

Therefore, your customary tedious insistence on minimal attributions is
contrary to respected recent thinking.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #14
JR wrote:
Hi. I hope someone out there who is more versed with JavaScript than
I can help me with the following annoying problem. Here's the
problem.

I have a form with the following layout:

Column A Column B Column C
data 4 radio buttons more data
... ... ...
... ... ...

The form does have a submit button that leads to a given CGI script.
The form also has submit buttons as onClick events inside of the radio
buttons, that point to a different CGI script. The problem is that I
need to know which particular radio button triggered the onClick
event, because when I receive the form data, I only want to process
the row of data for which an event was triggered. As the script is
now, I just receive everything from the form, without knowing which
row to actually process. The one thing I thought about trying was to
call a function with the onClick event that would receive a given row
id (1 through up to 279), and the use document.write to create a
hidden value for just that id. I don't know if this is workable,
though. Am I on the right track with this idea? Is this doable, or
should I think about trying a different approach?

Thanks!!!

Since this conversation seems to have drifted from the point, I'll do my
part to direct it back.

Message author bruce seemed to have the answer to the original question
which allows JR to keep his form as it is. I intend to include code
(not tested, just making it up as I type) to support bruce's idea.
<head>....
<script>
function testButtons(but tonArray)
{
len = buttonArray.len gth
for(i=0;i<len;i ++)
{
if(buttonArray[i].checked)
{
widelyVisibleVa riable = i;
return true;
{
}
}
</script>
......</head>

<body>
....
<form name=someName action=someServ er onSubmit=testBu ttons(buttonGro upName)>
....
</form>
</body>
Jul 23 '05 #15
On 30/03/2005 17:55, Jeff Sandler wrote:

[snip]
Since this conversation seems to have drifted from the point, I'll do my
part to direct it back.


This that conversation is almost a year old, was it really necessary
to resurrect it?

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
18609
by: Matt | last post by:
I have radio buttons on a form, and when the user makes the selection, it will trigger the event and send the form to the web server and print the selected value. In Case 1, I just use submit button, without any event handling, and it works fine. However, in Case 2, which is what I am trying to do, it has the problem that even when the user clicks the button, it won't show the value automatically. But wait until user selects another...
1
6163
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there are no instructions on how to make checkboxes and radio buttons required. I've tried adding these to my form, but I'm having no luck. Anyone know how to add radio buttons and checkboxes using the existing code mentioned on the url? Thank you!
6
18831
by: HD | last post by:
Hi. I have an asp page with radio buttons and a combobox... when the user clicks a radio button, I want the form to submit so I can execute the ASP code in order to change the list shown in the combobox... I have 2 radiobuttons: <input type="radio" name="terriprod" value="E">E <input type="radio" name="terriprod" value="D">D I have tried adding an OnClick event to each of the radio button...
3
1625
by: MarsVoyager | last post by:
Hi, I want to change the value of a submit button when the onChange event is fired by a Radio Input. Problem is, it seems the value is modified in the gui only when the Radio Input looses focus, not when its value is changed by the user. How can I make the value on the submit button change immediately upon action on the radio input and not when focus changes ? Thanks...
9
2254
by: IchBin | last post by:
I can not see what the problem is with this script. I am just trying to set a radio button by calling setCheckedValue('abbr_letter', 'V'). Sorry I am new to javascript. <html> <head> <script type="text/javascript"> function setCheckedValue(radioObj, newValue) { if(!radioObj)
1
3231
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio button with this link of code: echo 'SCRIPT language=JavaScript setCheckedValue("'.$_SESSION.'");</SCRIPT>'; //? <snip of code>
10
6104
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio button with this link of code: echo 'SCRIPT language=JavaScript setCheckedValue("'.$_SESSION.'");</SCRIPT>'; //? <snip of code>
8
4616
by: photoboy | last post by:
I have racked by brain long enough on this, so now I need the help of someone who knows what they are doing. Here is what I am trying to achieve: First, I have two radio buttons (both unchecked) that need to be validated when the submit button is clicked. Instead of the standard alert window popping up (which I have now), I want the radio button background color to change from the table color (E2E2E2) to red (FF0000) for both buttons...
7
4875
by: moksha | last post by:
Hi, I am new to javascript and i am facing a problem in coding. plz help me out. I am using javascript for dynamically creating a table row which contains text boxes and radio buttons and check box. I am adding two radio buttons once for a row.Now my problem is the radio buttons in all the rows that added dynamically are behaving as same group i.e when i am selecting a radio button in second row,radio button in first row...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.