- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Radio Button Keeps Resetting on Submit
Hey there,
I’ve got these two radio buttons, the problem is when you click on the ‘Renting’ radio button and submit the form the radio buttons reset back to the default ‘Buying’ button. Any idea how to stop the radio button resetting every time?
Buying
Renting
Thanks in advance!
You call for a javascript event without declaring the script inside your html, is that possible?
Realph it goes back because by default checked=”checked” is on the Buying – so when the page loads (if it has to reload on submit) you will get that one.
You could create a hidden field and use the input value to build the page next time round by putting in the checked by php “if else” statement… or something like that :)
This is for you Eclipse :D
Thanks Robskiwarrior
Hey Robskiwarrior,
Thanks for the help but could you possibly elaborate?
I’ve taken the ‘checked=”checked”‘ off and it’s removed the checked Radio Button, what kind of workaround would I have to do if I wanted the button to stay checked on what was selected before the page reloaded?