Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How do I get a form to refresh when a radio button is clicked?

    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!
    Last edited by Roby; 02-27-2005 at 11:01 PM.

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    You can't do that with HTML/CSS. try the PHP or JS sections of this site for more answers.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok will do, thank you.

  • #4
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For anyone who wants to know, I found out that you use:

    onClick=(form.submit())

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Glad you found a resolution to your problem!

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •