Jump to content

Displaying HTML Form Fields Depending on Another Field


Thauwa
Go to solution Solved by Jessica,

Recommended Posts

Hey folks!

I hope that I posted this in the right section.

 

For some time now, I've been wanting to know how to have HTML form fields of the same form appear/disappear depending on the value of one of the fields in that form itself. Will this require JavaScript? Am I trying to step into something too complex?

 

Here's an example of what I'm trying to learn about:

 

There is a form, which at first displays only a drop-down box with values from "1-5". If the user selects "2", two text fields will appear below the drop-down box. If the user then selects "1", the two fields become one. If "5" is selected, the total number of fields visible will be five.

The five fields available will belong to the same form, and overall, there will be only five text fields present (not 1+2+3+4+5=15). 

Does anyone know how I could achieve this? I just want to get an idea of how to get this done.

 

I hope that I didn't sound confusing.

I will appreciate any help offered, and I thank you for reading!

 

Thanks and Regards,

Thauwa.

Edited by Thauwa
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.