radio button looses the selected state after validation

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2005
Posts: 183
Reputation: hbmarar is an unknown quantity at this point 
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

radio button looses the selected state after validation

 
0
  #1
Nov 23rd, 2007
Hi,

I got a form page with 3 radio buttons. Radio button ,say A,B,C.

billing and shipping address is what the form page consists of . Onclikc of A the user selects hide shipping address. On click of b , copy billing to shipping address as well and on click of C, user would type in a diff shipping address... All works fine.but when i submit the form, and if form not complete, the after validation forms gets all the value but do not retain the selected radio button and the shipping form elements disabled or hidden status..

How could i tackle this issue?


Regards

Hari
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,652
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: radio button looses the selected state after validation

 
0
  #2
Nov 23rd, 2007
> How could i tackle this issue?
By preserving the incomplete data submitted by the user and populating your HTML controls with it. Just store those user preferences in a bean class and store it in a session variable.

On the dynamic page, just read those values. If they are not null, populate the corresponding HTML control with it, otherwise use the default value for that control.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 1
Reputation: its4masti is an unknown quantity at this point 
Solved Threads: 0
its4masti its4masti is offline Offline
Newbie Poster

Re: radio button looses the selected state after validation

 
0
  #3
Apr 1st, 2009
Originally Posted by ~s.o.s~ View Post
> How could i tackle this issue?
By preserving the incomplete data submitted by the user and populating your HTML controls with it. Just store those user preferences in a bean class and store it in a session variable.

On the dynamic page, just read those values. If they are not null, populate the corresponding HTML control with it, otherwise use the default value for that control.
I've kind of same issue where I've 5 radio buttons of JSF controls, for each selection I would show corresponding text box and validate button, After submission of form and while rendering my response back to page, I would like to retain selected radio button and show data in disabled mode.
Please can you put code snippet here.

I appreciate...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 4247 | Replies: 2
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC