wood burning stoves*
The moose likes JSP and the fly likes selecting one radio button from a matrix of radio button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "selecting one radio button from a matrix of radio button" Watch "selecting one radio button from a matrix of radio button" New topic
Author

selecting one radio button from a matrix of radio button

ankita sarma
Greenhorn

Joined: Nov 13, 2012
Posts: 25
I have a Jsp page with a radio button matrix like this


Time Name

10-10:30 A O B O C O
11-11:-30 B O C O

here A,B,C are service providers. according to there available timings the above matrix gets generated.

like in the time slot 10-10-30 all the service providers are available , in 11-11:30 only two service providers B,C are available.

The question here is that an end user "D" should be able to select only one service provider for one time slot only.

That means from the above matrix only one radio button should get selected.

I have implemented the code for one service provider.

PROBLEM

when i try to select in the case of multiple service providers all the radio buttons of a row gets selected. I just want only one radio button from the whole matrix to get selected.

I dont know how to handle this.

I cannot post the code as I am working in some organisation.

Please Help

Hints are also appreciated.I understand that without the code much help can't be expected.

Regards :)
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1447
    
    6

Ankita,

Do you mean that from different time slots, user can select one service provider? Considering your example between 10-10:30 I can select either of A,B,C and from 11-11:30 I can select either of B and C. Does that mean I can select two service providers from two different time slots?


Swastik
ankita sarma
Greenhorn

Joined: Nov 13, 2012
Posts: 25
Hi,

No from the whole matrix only one selection.

means if I am the end user i can choose only timeslot and hence only one service provider.

I hope that clarifies.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1447
    
    6

So, what is the problem are you facing?
ankita sarma
Greenhorn

Joined: Nov 13, 2012
Posts: 25
when i am selecting say A for the time slot 10-10:30 then only that radio button corresponding to A should dissapear.

But when I come back to the same screen all the three radio buttons corresponding to timeslot 10-10:30 dissapear.

The problem is If there are say three end users

If one user books a slot of 10-10:30 with service provider A other service providers B and C are still available.

But what is happening in my case is all the radio buttons corresponding to a row are getting disspeared even if only one radio button is getting selected.

how do i diffrentiate between each of them

Note : I am using struts framework.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1447
    
    6

Without having some look on your code, it's bit difficult to analyze.
ankita sarma
Greenhorn

Joined: Nov 13, 2012
Posts: 25
i know

right now i am using document.forms.getelement[radio.checked].value

for storing the value when i am using single service provider

since in the case of single provider

time name

10-10:20 A O

11-11:30 B O


its like the above case so its easy to handle one radio button in each row

can you suggest how can i use this documents.getelemnt thing for multiple radio buttons in each row??
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1447
    
    6

Ankita,

I tried this with a small html code snippet, not sure if this helps you

ankita sarma
Greenhorn

Joined: Nov 13, 2012
Posts: 25
I will let you know if it worked or not ;-) wink
ankita sarma
Greenhorn

Joined: Nov 13, 2012
Posts: 25
hay thanxxx :-)
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1447
    
    6

You are most welcome.
 
Consider Paul's rocket mass heater.
 
subject: selecting one radio button from a matrix of radio button
 
Similar Threads
Mock questions required answers
A Tricky Stored Procedure
radio buttons selection
long post IBM.158
157 Question Help and Resourses