Thauwa Posted May 23, 2013 Share Posted May 23, 2013 (edited) 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 May 23, 2013 by Thauwa Quote Link to comment Share on other sites More sharing options...
Solution Jessica Posted May 23, 2013 Solution Share Posted May 23, 2013 Yes, JavaScript. Check out jQuery Quote Link to comment Share on other sites More sharing options...
Thauwa Posted May 24, 2013 Author Share Posted May 24, 2013 Thank you so much for putting me on the right track! I found a sample code here: http://anthonygthomas.com/2010/03/14/display-form-fields-based-on-selection-using-jquery/ Once again, I thank you for your time and reply. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.