Java checkform

movieprodw
movieprodw used Ask the Experts™
on
Hello,

I am using the function below and I would like to have it so that prop_desc needs to have more the 100 characters or there is an alert 'Please make your description a little longer'.

function checkform(form)
{
  if (form.userId.value == "" || form.firstname.value == "" || form.lastname.value == "" || form.phonenumber.value == "" || form.price.value == "" || form.zip.value == "" || form.title.value == "" || form.build_year.value == "" || form.sq_ft.value == "" || form.prop_desc.value == "") {
    alert( "Please complete all of the required* fields." );
    return false;
  }
  onSubmitButton();
  return true;
}
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Add this
function checkform(form)
{
  if (form.userId.value == "" || form.firstname.value == "" || form.lastname.value == "" || form.phonenumber.value == "" || form.price.value == "" || form.zip.value == "" || form.title.value == "" || form.build_year.value == "" || form.sq_ft.value == "" || form.prop_desc.value == "") {
    alert( "Please complete all of the required* fields." );
    return false;
  }


  if (form.prop_desc.value.length < 100) {
    alert( "Please make your description a little longer" );
    return false;
  }  

  onSubmitButton();
  return true;
} 

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial