473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Form and radio issue

How do I keep Radio button values and not lose them after a Form is submitted? I have no problem keeping text values where a form is submitted and if there is a validation issue with the text value it takes me back to the Form and shows the Form text value that was submitted. With Radio buttons it clears the Form Radio selection.

JavaBean:
Expand|Select|Wrap|Line Numbers
  1. public void setNotify(String n) {
  2.     notify=n;
  3.   }
  4.  public String getNotify() {
  5.     return notify;
  6.   }

Form in JSP:
Expand|Select|Wrap|Line Numbers
  1. <jsp:useBean id="formHandler" class="Concord.FormBean" scope="request"/>
  2.  
  3. <form action="process.jsp" method=post>
  4. ....
  5. Yes <input type="radio" name="notify" value="Yes" <jsp:getProperty name="formHandler" property="notify" /> >   <br>      
  6. No <input type="radio" name="notify" value="No"  <jsp:getProperty name="formHandler" property="notify" /> > 
Please advise.
Oct 31 '07 #1
1 1651
dmjpro
2,476 2GB
How do I keep Radio button values and not lose them after a Form is submitted? I have no problem keeping text values where a form is submitted and if there is a validation issue with the text value it takes me back to the Form and shows the Form text value that was submitted. With Radio buttons it clears the Form Radio selection.

JavaBean:
Expand|Select|Wrap|Line Numbers
  1. public void setNotify(String n) {
  2.     notify=n;
  3.   }
  4.  public String getNotify() {
  5.     return notify;
  6.   }

Form in JSP:
Expand|Select|Wrap|Line Numbers
  1. <jsp:useBean id="formHandler" class="Concord.FormBean" scope="request"/>
  2.  
  3. <form action="process.jsp" method=post>
  4. ....
  5. Yes <input type="radio" name="notify" value="Yes" <jsp:getProperty name="formHandler" property="notify" /> >   <br>      
  6. No <input type="radio" name="notify" value="No"  <jsp:getProperty name="formHandler" property="notify" /> > 
Please advise.
Where you are doing validation?
I mean at server Side or at Client Side?
If that is at Server Side and you want to back to the form if validation fails then you can achieve it using Cookie.
If that is at Client Side then I think no question of clear selection.

Debasis
Oct 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Claire Osborne | last post by:
I have created a form at http://www.habitatforhumanity.org.uk/html/gv_indiv_apply.htm In the Medical Details section we need to ensure that if a radio button is clicked to indicate a health...
3
by: Garmt de Vries | last post by:
On the website of the Dutch Jules Verne Society (www.jules-verne.nl), we have several forms that visitors can use to order something, or to apply for membership. Of course, a form's primary purpose...
4
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page...
1
by: Suma | last post by:
Hi, i have a problem with the controls .i have to validate Form1 Radio button option is checked or Not in the Form2. even after checking the radio button also in FOrm2 it is always taking as...
3
by: Ralph | last post by:
Hi I have small function to generate my form controls: function buildInput(sType, vValue, vId, sName, sLabel){ var oInput = null; var oLabel = document.createElement('label'); var oCont =...
0
by: jianxin9 | last post by:
Hi everyone, I don't have a lot of experience with ASP and I was hoping someone could help me. I want to use our ASP form along with some javascript code to create a form where our patrons can...
1
by: filmfanatic | last post by:
In this emal form, I'm trying to consolidate all the input into the TEXTAREA portion and then have it emailed to a specific person. I've tried the onClick and onBlur commands but only one field's...
11
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server...
1
by: printline | last post by:
Hello All I'm quite new to xml vs. PHP, so i hope someone can help with an issue i have been struggeling with. I have an html form, that when submitted, it should create an xml file, and save...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.