Jump to content
Server Maintenance This Week. ×

making fields required on a form


This topic is 7824 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Here is an example:

This Javascript goes between the <head.. tags:

<script>

function checkField() {

if (document.myform.myfield.value) == "") {

alert("Field cannot be empty") ; }

else {

document.myform.submit() ; } ;

} ;

</script>


This is your form:
<form name="myform" action="FMPro" method="post" onsubmit="checkField(); return false;">

.

.

Enter Field:<input type="text" name="myField" value="">

<input type="button" value="Find" onclick="checkField();">

</form>


Hope this helps.

Garry

Link to comment
Share on other sites

This topic is 7824 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.