A client wants a contact form, wherein the user clicks certain radio buttons and depending on the choice it shows more form data.
I've got it to work so that when the user clicks the radio buttons it changes the display of a specific div to 'block'.
But the problem lies in that the user can only choose 1 of the radio buttons, not multiple. So if they click one then the other etc all the div's get shown.
I can make it so once one is chosen then they click another the other disappears (using the onblur) BUT it happens to ANY form fields on the page. Meaning when they fill in some more information below that div disappears again.
Heres the css
<label>
<input type="radio" name="Business Type" value="Residential" onclick="hideshow(document.getElementById('Residential'))" onblur="hideshow(document.getElementById('Residential'))" />
<strong>Residential</strong></label>
- (care homes, hotels etc.)<br />
<label>
<input type="radio" name="Business Type" value="Commercial" onclick="hideshow(document.getElementById('Commercial'))" onblur="hideshow(document.getElementById('Commercial'))" />
<strong>Commercial</strong></label>
- (shop, pub, club etc.)<br />
<label>
<input type="radio" name="Business Type" value="Industrial" onclick="hideshow(document.getElementById('Industrial'))" onblur="hideshow(document.getElementById('Industrial'))" />
<strong>Industrial</strong></label>
- (factory, warehouse etc.) <br />
<label>
<input type="radio" name="Business Type" value="Transport" onclick="hideshow(document.getElementById('Transport'))" onblur="hideshow(document.getElementById('Transport'))" />
<strong>Transport</strong></label>
- (train station, airport etc.) <br />
<label>
<input type="radio" name="Business Type" value="Outdoor Event" onclick="hideshow(document.getElementById('Outdoor'))" onblur="hideshow(document.getElementById('Outdoor'))" />
<strong>Outdoor Event</strong></label>
- (concerts, firework displays etc.) <br />
<label>
<input type="radio" name="Business Type" value="Other" onclick="hideshow(document.getElementById('Other'))" onblur="hideshow(document.getElementById('Other'))" />
<strong>Other</strong></label>


Help
This topic is locked

MultiQuote












