Radio Buttons, PHP, and Javascript

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Radio Buttons, PHP, and Javascript

Post 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
Post Reply