954,219 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

radio button looses the selected state after validation

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

hbmarar
Junior Poster
190 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

> 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.

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 733
 

> 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...

its4masti
Newbie Poster
1 post since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You