Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onchange

Status
Not open for further replies.

jbanas

Programmer
Sep 18, 2007
18
US
i have 3 radio buttons that produce some different links below them. I am having an issue with javascripts onchange feature. When one of the radio buttons is selected it should refresh the page. Unfortunately it is not. Any help would be great. Here is the function i have created. When you click any radio button it defaults to the first radio button.

function chgBUS() {
document.tocform.IBIF_ex.value="JBTOC3";
action="/cgi-bin/ibi_cgi/ibiweb.exe";
document.tocform.target="_self";
document.tocform.submit();

}
 
So what you're saying is after the page is reloaded, the radio button group defaults back to the first button selected?

If this is a case, then this is not a javascript issue. It *could* be handled with javascript, but it would be a job better suited for ASP, or PHP, or whatever server side language you're using. In the case of ASP, I'd do something like this:

Code:
<input type="radio" name="blah" value="1" [!]<%=((selectedValue == 1) ? 'selected="selected"' : '')%>[/!] />
<input type="radio" name="blah" value="2" [!]<%=((selectedValue == 2) ? 'selected="selected"' : '')%>[/!] />

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top