0

Hi Everyone,
I am using javascript to validate a form:
http://www.cultureisaweapon.org/pals/hospital/contract.html

the errors show up as necessary; however, when someone does not enter a required field, and the errors show up; the form displays itself at the middle - is there any way, a function I can use, to display the web page at the beginning(top) or at the end(bottom)?

here is the link:
http://www.cultureisaweapon.org/pals/hospital/contract.html

thank you for your help!

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by essential
0

You can do it with CSS and a few lines of javascript:
Let's say you have this classes in CSS rules.

form {
  min-height : 300px;
  margin : 0 auto;
  width : 95%; } /* which stated on the current form position */
form.move-to-bottom {
   position : absolute;
   bottom : 10%; } /* its up to you where to put the form */
// Any conditional statement's that you can provide -
function moveForm() {
var x = document.forms['yourFormId'];
if ( true ) { // if true then move the form

x.className = "move-to-bottom"; }
else { // do nothing

   x.removeAttribute("class"); }
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.