# Contact form non required fields

**URL:** <https://forum.kirupa.com/t/contact-form-non-required-fields/288658>\
**Category:** flash\
**Created:** [May 19, 2009, 2:23pm UTC](https://forum.kirupa.com/t/contact-form-non-required-fields/288658 "2009-05-19T14:23:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marvinnr1](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@marvinnr1](https://forum.kirupa.com/u/marvinnr1)\
**Post date:** [May 19, 2009, 2:23pm UTC](https://forum.kirupa.com/t/contact-form-non-required-fields/288658/1 "2009-05-19T14:23:25Z")

</div>

Hi,

I have a contact form which works correct, however I want to add two non required fields in the AS. I can’t get it to work.  
The two fields are company\_name and web\_name (I have added these files in the reset function below), these are not required to be filled out.  
I can’t get it to work so that they are not required to be filled out at the submit function.

I hope you can help me with this.

```auto
this._parent.btns.btnsend.onRelease = submit;
this._parent.btns.btnclear.onRelease = reset;
function submit()
{
 if( contact_name.text == "" || contact_email.text == "" ||
  contact_subject.text == "" || contact_message.text == "" )
 {
  message_status.text = "Please fill up all text fields.";
 }
 else if( contact_email.text.indexOf('@') < 2 || contact_email.text.indexOf('.') < 0 )
 {
  message_status.text = "Please enter the valid email address.";
 }
 else
 {
  message_status.text = "";
  gotoAndStop("send");
 }
}
function reset()
{
 contact_name.text = contact_email.text = contact_subject.text = company_name.text = web_name.text =  
 contact_message.text = message_status.text = "";
 clearInterval(interval_id);
 gotoAndStop("stop");
}

```

Thanks
