mercredi 23 septembre 2015

HTML using label to select checkbox and bring to top of page

I have a page that has a checkbox at the top. I want a down the page to select the checkbox so the user can continue.
The problem is when you click the label, it scrolls to the checkbox directly at the top of the users screen. However I need the page to go to the top of the page as well so the user can see everything above the check box.

Sample: Top of page ID = #top ...

<input class="css-checkbox" id="PSRchk" type="radio" name="PSR" value="YES" required>
<label class="css-label" for="PSRchk">YES</label>                 
<input class="css-checkbox" id="PSRchk2" type="radio" name="PSR" value="NO" onclick="location.href='#PSR'">
<label class="css-label" for="PSRchk2">NO</label>

    ... Pages of code ...


    <label for="PSRchk">I Agree</label>




Aucun commentaire:

Enregistrer un commentaire