Jump to content

javascript forms


php_b34st

Recommended Posts

Hi,

I have never written in javascript before however I think I need it now. I want to make a script which will enable me to dispkay a different form depending on which checkbox is checked without submitting the form.

 

example:

Say i have checkbox A and B when checkbox A is checked I want to display text field A and a dropdown menu, if checkbox b is checked i want to display text field B and Text field C

 

I think this will only be possible using javascript but as I said at the start I havent done any javascript in the past and wouldnt know where to start. Can anybody give any pointers as to where to begin, what to look for, what kind of functions i will need for this script. That is if this is even possible with javascript?

 

thanks in advance

 

Link to comment
Share on other sites

You have to use js and css.

 

Keep the forms in divs and then change the display to block to be seen and to none to hide it.

Put this on the onclick event of the checkbox. Also you must check if the user is checking or unchecking the checkbox

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.