# Contact Form - Checking the fields

**URL:** <https://forum.kirupa.com/t/contact-form-checking-the-fields/157985>\
**Category:** flash\
**Created:** [August 5, 2005, 4:59pm UTC](https://forum.kirupa.com/t/contact-form-checking-the-fields/157985 "2005-08-05T16:59:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vexir](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vexir](https://forum.kirupa.com/u/Vexir)\
**Post date:** [August 5, 2005, 4:59pm UTC](https://forum.kirupa.com/t/contact-form-checking-the-fields/157985/1 "2005-08-05T16:59:58Z")

</div>

Hey guys, I wanted to make a contact form which checks all the fields to see if they are empty or have their defualt values still, code is as follows… but it doesn’t work:

```auto
on (release) {
	// Define the default string values for the inputs.
nameboxdefault = "Enter your full name here.";
emailboxdefault = "Enter a valid e-mail address here.";
companyboxdefault = "Enter your company's name here.";
commentsboxdefault = "Enter any comments you have here.";
// Set the variable that allows the data to be sent.
okaytosend = 1;
//Process all the forms. If one is unsatisfactory, the field must be edited to be satisfactory
//and then the button must be reclicked.
    if (_root.form.namebox.text == nameboxdefault || _root.form.namebox.text == ""){ 
        _root.form.namebox.text = nameboxdefault;
		okaytosend = 0;
    } 

    if (_root.form.emailbox.text == emailboxdefault || _root.form.emailbox.text == ""){ 
        _root.form.emailbox.text = emailboxdefault;
		okaytosend = 0;
    } 

    if (_root.form.companybox.text == companyboxdefault || _root.form.companybox.text == ""){ 
        _root.form.companybox.text = companyboxdefault;
		okaytosend = 0;
    } 

    if (_root.form.commentsbox.text == commentsboxdefault || _root.form.commentsbox.text == ""){ 
        _root.form.commentsbox.text = commentsboxdefault;
		okaytosend = 0;
    } 
	
	// If the allowing variable is true, send the information.
	if (okaytosend = 1) {
	form.loadVariables("email.php", "POST");
	}
}

```

Can you guys help? This code is on the submit button 😉
