Ikkeboeken wrote:
Quote:
anyone know a simple java script to share that i could use to inform
customers that the data for a particular form field, checkbox, menu, etc...
is mandatory to be filled in in order to proceed. perhaps with a string as
well to use to validate an argument to check for @ in an email address,
etc... |
In the button:
<input type="button" ... onClick="ValidateForm()" ... />
In the head tag:
<script>
function ValidateForm(){
// Variable shows that form has been filled in properly
var Completed = true
/* Now we have statements that define Completed as FALSE if there is
something missing in the form */
if(FORM_NAME.FIELD_NAME.value==""){Completed = false}
var BufferArray() = FORM_NAME.EMAIL_FIELD.value.split("@")
if(BufferArray[1]==false){Completed = false}
if(Completed==true){...do some shit, redirect to some page with submit
info}else{alert("Fill in the form properly, fuck-face!")}
}
</script>
Totally un-tested, use at own risk! You didn't give us much details there!