Checking if one field is populated, the other 2 are as well

I think i need to use if-else for this but maybe there's a better way of doing this.

I have a fax number field...divided in 3 fields. Fax is NOT a required but still, i dont want users to enter something 999 99 (incomplete data).

How can i check that if , for example, area code is filled, the other 2 fields are also populated?

I do use a regularexpressionvalidtor to check for length of fields.
        <td width="137"><label for="fax">Fax number:</label></td>
        <td width="310">
    (<input type='text' name="fax1" id="fax1" runat="server" class='autotabindex' tabindex="11" maxlength="3" style='width:12%'/>)
    <input type='text' name="fax2" id="fax2" runat="server" class='autotabindex' tabindex="12" maxlength="3" style='width:12%'/>
    <input type='text' name="fax3" id="fax3" runat="server" class='autotabindex' tabindex="13" maxlength="4" style='width:20%'/>
        <td width="280">
        <span class="feedback">
        <asp:RegularExpressionValidator ID="RegularExpressionValidator11" runat="server" ControlToValidate="fax1" ValidationExpression="^[0-9]{3}$" ErrorMessage="Invalid!" Text="Invalid!"></asp:RegularExpressionValidator>
          <asp:RegularExpressionValidator ID="RegularExpressionValidator12" runat="server" ControlToValidate="fax2" ValidationExpression="^[0-9]{3}$" ErrorMessage="Invalid!" Text="Invalid!"></asp:RegularExpressionValidator>
          <asp:RegularExpressionValidator ID="RegularExpressionValidator13" runat="server" ControlToValidate="fax3" ValidationExpression="^[0-9]{4}$" ErrorMessage="Invalid!" Text="Invalid!"></asp:RegularExpressionValidator>

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun KlineLead Software EngineerCommented:
You would have two options, either using straight javascript or using a custom validator. The custom validator uses the code behind, and therefore would require a postback event.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CamilliaAuthor Commented:
How can I do it with Javascript? what should i google for?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.