...

View Full Version : How do I get a form to refresh when a radio button is clicked?



Roby
02-27-2005, 07:13 PM
I am trying to create a registration form. The user might want to enter either business details or personal details so I am using radio buttons for the user to select what type of details they want to enter. I have got it working so that it will enable and disable the appropriate textfields after a submit button has been selected (using an if.. else statement in php), however I want it to enable and disable the appropriate textfields as soon as the radio button is clicked (ie not using the submit button).

The following is the html code I have got for the radio buttons:
<TR><TD>&nbsp</TD><TD><INPUT TYPE = "radio" NAME="addressType" VALUE='personal' {$c1} onClick='registrationForm.php' />Personal Address</TD></TR>
<TR><TD>&nbsp</TD><TD><INPUT TYPE = "radio" NAME="addressType" VALUE='business' {$c2} onClick='registrationForm.php' />Business Address</TD></TR>

Can anyone help me please?
Im a novice please go easy!

whizard
02-28-2005, 02:55 AM
You can't do that with HTML/CSS. try the PHP or JS sections of this site for more answers.

Dan

Roby
02-28-2005, 02:11 PM
Ok will do, thank you.

Roby
02-28-2005, 07:06 PM
For anyone who wants to know, I found out that you use:

onClick=(form.submit())

whizard
02-28-2005, 07:12 PM
Glad you found a resolution to your problem! :)

Dan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum