I have a form that I change after processing it through jquery - just because I have no control over the code that creates the form.
In any case, I add a button next to the login button, which is part of the form. For this, I use the following jquery:
$('.mynewbutton').hide(); $(".submit").addClass("buttonalign"); $('<div class="shared">').insertBefore($('.submit')); $('.submit').after($('<div class="circle circlealign">i</div>'));
The new button that I am adding is actually a circle that I drew using css. This works great - the new button matches the login. Here's the css:
.shared { position: absolute; width: 200px; } .buttonalign { position: absolute; top:340px; } .circlealign { position: absolute; top:340px; }
The problem I need to solve is when the login form returns an error message, it displays an error at the top of the form and everything pushes everything. Thus, my login button and the new button end on some other form elements because their position is fixed.
I changed the fixed numbers to percent and em like this:
.shared { position: absolute; width: 100%; } .buttonalign { position: absolute; top:40em; } .circlealign { position: absolute; top:40em; }
But this changed the position of the new button so that it no longer aligns with the enter button. this is the path below on the page.
Can you point me in the right direction?
Thanks.
EDIT 1
The HTML presented here .. and of course the jquery stuff doesn't appear here, which is a pain .. but you can see what the original form looks like
<H1>Login</H1><DL> <P class="err">Logon Failed</P> <form action="/cgi-bin/logon/logon" method="POST"> <DT>User ID</DT> <DD> <input class=" text" type="text" name="userid"> </DD> <DT>Password</DT> <DD> <input class=" password" type="password" name="password" > </DD> <DT></DT><DD><input class="submit" type="submit" name="submit" value="Logon"> </DD> </FORM></DL>
source share