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!

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"); }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.