I’m wondering if a jQuery or JS library exists that does the following:
Based on what a user inputs in A01, check that value, and if that value is equal to ‘x’, make A01_1 visible. If not, do nothing.
<form id="survey">
<fieldset>
<label for="A01">A01</label>
<input type="number" name="A01" id="A01" min="0" max="5" >
<label for="A01_1">A01_1</label>
<input type="text" name="A01_1" id="A01_1" >
I guess I’m looking for some sort of inline validation function that will make another element visible if it matches a specific input. I need to apply this in a number of different places so I want to make it a reusable function.
My JS skills are limited so any help (where to start etc.) is greatly appreciated.
For reuse you can change you markup like:
And change jQuery like: