I have to axe somebody...onclick + anchor links

Myler

the horror.
Apr 25, 2009
531
6
0
G16
I have a form user fill on my website. Actually there are have 2 separate different forms, Form A and Form B.

I made a simple img button and assigned a simple slidetoggle onclick event like this;

Code:
<img src="bt.jpg" alt="" width="150" height="100" style="cursor:pointer;" onclick="$('#aform').slideToggle('slow');" />

When user presses this button, it slide opens the first form. The problem is, usually there is only 1 or 2 fields visible in the viewport...because people tend to click on a button as soon as they see it.

So the solution would be to make the viewport jump to the (anchor?) first field of the form which would make the form display across the entire viewport.

Any solutions for this?
 


AD_YouBettaAxeSomebody-e1335211499485.jpg
 
This should do the trick.

Code:
<img src="bt.jpg" alt="" width="150" height="100" style="cursor:pointer;" onclick="location.href='http://www.googlehammer.com/';" />
 
But the thing is there are two forms, so to keep the visitors from scattering around the site, I applied both forms with
style="display:none;"

So they can't be seen until you click the button. But they slide down barely being in the viewport

- link should trigger the slideToggle effect on the form and make the form scroll out
- jump to the anchor placed right above the form to make it appear across the entire viewport

:D