itsjareds
06-08-2008, 07:20 PM
I'm trying to add another field to a form on a site using Greasemonkey and save the value of whichever radio button is clicked.
Right now I have a "yes" and "no" button with the values 1 and 0.
I have a global variable in my script. formval = 1;
checkRadio() is a function to check which radio button is clicked.
When the user clicks submit, I want it do this: "formval = checkradio[0].value"
However, since at the top the global variable has formval = 1, each time the page is refreshed, formval will go back to 1. I want it to stay 0 if I click 0.
Does anyone have any help?
Right now I have a "yes" and "no" button with the values 1 and 0.
I have a global variable in my script. formval = 1;
checkRadio() is a function to check which radio button is clicked.
When the user clicks submit, I want it do this: "formval = checkradio[0].value"
However, since at the top the global variable has formval = 1, each time the page is refreshed, formval will go back to 1. I want it to stay 0 if I click 0.
Does anyone have any help?