944,179 Members | Top Members by Rank

Ad:
Nov 23rd, 2007
0

radio button looses the selected state after validation

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
hbmarar is offline Offline
187 posts
since Apr 2005
Nov 23rd, 2007
0

Re: radio button looses the selected state after validation

> 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.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
Apr 1st, 2009
0

Re: radio button looses the selected state after validation

Click to Expand / Collapse  Quote originally posted by ~s.o.s~ ...
> 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...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
its4masti is offline Offline
1 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Does this look right, to reload iframes?
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: I would like to reveal (unhide) a div after displaying a 10 second countdown





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC