Page 1 of 1

Radio Buttons, PHP, and Javascript

Posted: Wed Jan 26, 2005 12:54 pm
by neophyte
I'm working on a massive 75-80 field form. It's got radio buttons in the form. I need to be able to return errors to the user and have fields, including the radio buttons, filled in the way the user submitted them. I'm trying to avoid using PHP to write the the radio button html/checked button. So I'm hoping to find a javascript solution.

Here's what I'm trying to do.

First when a radio button is clicked the value of a hidden field is changed to reflect the value of the radio button. I can then use the hidden field to pull data from.

I can do that using this:

Code: Select all

function send_hidden(str, val) 
{
document.Form1.dingle_berry.value = val;
}
onClick='send_hidden(this.name,  this.value)'
Checking onload is entirely another problem that probably will involve some php and javascript...

Has anybody problem before and attempted this solution before?

Is there a better solution?

Does anybody know of an existing script I can snag?

Thanks