Jump to content

[SOLVED] check for value


waz

Recommended Posts

i have done what i think should work but it doesnt seem to can someplease highlight what i have done wrong please many thanks

 

 

<script language="javascript" type="text/javascript">

function showAlert() {

if((document.form1.textfield.value.length ! "" && document.form1.textfield2.value.length <> ""))

  {

          alert("Please fill out Both Date Values.\n");

  return false;

      }

}

</script>

 

<form id="form1" name="form1" method="post" action="">

  <p> </p>

  <p>

    <label>

    <input type="text" name="textfield" />

    </label>

  </p>

  <p>

    <label>

    <input type="text" name="textfield2" />

    </label>

  </p>

  <p>

    <label>

    <input type="submit" name="Submit" onClick="showAlert()" value="Submit"/>

    </label>

  </p>

</form>

 

 

Link to comment
https://forums.phpfreaks.com/topic/58071-solved-check-for-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.