I am sending the code of the file.Here the problem is that when I open the file,then both radio buttons are active.I want that when I open the file only one radio button is active.I know this will be done by "checked". But here I am using onChange=submit.When Page refreshes then the value which was first selected should remain same as selected before.I need help in this matter.Plz provide answer as early as possible. Again understand that after reshing the page which radio button was selected should remain selected after onChange=submit. Thanx <%@ page import=" java.sql.*, java.io.*, java.util.* "%>
You can use session variable or you can use request parameters. If you are using session variable then set the value of the radio button into sesion variable. eg:- Suppose you are submitting your form to be.jsp then assign the value of radio btn to the session variable using request.getParameter. Now when again you visiting your original JSP just check value of session variable. & depending n that decide which radio btn to be checked.
The same thing you can do with getParameter & getQueryString also.
Please only post one post per topic (if you need to edit your post - you can use the icon with paper and pencil above your text to edit it). If you have a large amount of code you can enclose it in [ code ] tags (and also try to only give relevant portions of your code - if you post a ton of code, it's going to take people longer to find the problem, and most people are just going to give up), and you can use the "Disable smilies in post" checkbox (one of the checkboxes under the smilie icons when editing your post) to prevent code statements being interpreted as smilies in your post.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Thank for reply.Basically I was using the forum first time.So I could not understand how to use it. And also thanx for giving the answer.I found my fault.Basically I was disabling both Radio buttons.SO the problem was creating. Many many Thanx for reply.Basically at that time my thinking was totally closed bcoz I was very tired.Sometimes the problem is very short but one cannot understand what is the matter.