Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6932539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:43:07+00:00 2026-05-27T11:43:07+00:00

I have a form on my uncles website that is created in an asp

  • 0

I have a form on my uncles website that is created in an asp page. The asp page submits to a php page. This is the only way I could work around FastHost actually letting the email get through to his mail.

I am trying to add validation in the head section in the form but this doesn’t seem to be working.

The code within the head section and form are as follows:

JavaScript:

<script type="text/javascript">

function validateForms() {
  var x=document.forms["myForm"]["frmname"].value;
  if (x==null || x=="") {
    alert("First name must be filled out");
    return false;
 }

  var x=document.forms["myForm"]["frmemail"].value;
  var atpos=x.indexOf("@");
  var dotpos=x.lastIndexOf(".");
  if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {
    alert("Not a valid e-mail address");
    return false;
  }
} 

</script>

The Form:

<form action="sendmail.php" onsubmit="return validateForms();" id="myForm" method="post">
                    <table  border="0" cellpadding="2" cellspacing="0" class="text">
                        <tr>
                            <td><p>Name : * </p></td>
                            <td><input name="frmName" id="frmName" type="text" class="textbox" value="<%=frmName%>" size="35" title="Required" /></td>
                        </tr>
                        <tr>
                            <td><p>Email : *</p></td>
                            <td><input name="frmEmail" id="frmEmail" type="email" class="textbox" value="<%=frmEmail%>" size="35" title="Required" /></td>
                        </tr>
                        <tr>
                            <td><p>Phone : </p></td>
                            <td><input name="frmPhone" id="frmPhone" type="text" class="textbox" value="<%=frmPhone%>" size="35" /></td>
                        </tr>
                        <tr>
                            <td><p>Address :</p></td>
                            <td><input name="frmAddress" id="frmAddress" type="text" class="textbox" value="<%=frmAddress%>" size="35" /></td>
                        </tr>
                        <tr>
                            <td><p>How did you hear about us :</p></td>
                            <td><select name="frmReferral" id="frmReferral" class="block" style="width: 180px">
                            <option value=""> - SELECT - </option>
                            <option value="Magazine advert"<%if frmReferral = "Magazine advert" then%> selected="true"<%end if%>>Magazine advert</option>
                            <option value="Booklet advert"<%if frmReferral = "Booklet advert" then%> selected="true"<%end if%>>Booklet advert</option>
                            <option value="Web search"<%if frmReferral = "Web search" then%> selected="true"<%end if%>>Web search</option>
                            <option value="Web directory"<%if frmReferral = "Web directory" then%> selected="true"<%end if%>>Web directory</option>
                            <option value="Newspaper"<%if frmReferral = "Newspaper" then%> selected="true"<%end if%>>Newspaper</option>
                            <option value="TV"<%if frmReferral = "TV" then%> selected="true"<%end if%>>TV</option>
                            <option value="Other"<%if frmReferral = "Other" then%> selected="true"<%end if%>>Other</option>
                            </select>
                            </td>
                        </tr>
                        <tr>
                            <td><p>Do you require a call back :</p></td>
                            <td><select name="frmCallback" id="frmCallback" class="block" style="width: 180px">
                            <option value=""> - SELECT - </option>
                            <option value="Morning"<%if frmCallback = "Morning" then%> selected="true"<%end if%>>Morning</option>
                            <option value="Afternoon"<%if frmCallback = "Afternoon" then%> selected="true"<%end if%>>Afternoon</option>
                            <option value="Not Required"<%if frmCallback = "Not Required" then%> selected="true"<%end if%>>Not Required</option>
                            </select>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" valign="top"><p>Enquiry :</p></td>
                            <td><textarea name="frmEnquiry" id="frmEnquiry" cols="27" rows="4" class="textbox" style="width: 180px"><%=frmEnquiry%></textarea></td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td align="right"><input name="submit" type="submit" value=" Send " class="submit">
                            &nbsp;&nbsp;&nbsp;
                            <input name="reset" type="reset" class="submit"></td>
                        </tr>
                    </table>
                    <p>&nbsp;</p>
                </form>

I would appreciate any help with this. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:43:08+00:00Added an answer on May 27, 2026 at 11:43 am

    frmname and frmemail need to be camel-cased like in their input tags.

    var x=document.forms["myForm"]["frmName"].value;
    var x=document.forms["myForm"]["frmEmail"].value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have form in my page, I am using ajax.beginform(). Inside this form I
I have: form.php preview.php form.php has a form in it with many dynamically created
I have form on my page that has the following code <form class=form> ...
I have form in my html page <form id=login_form method=POST action=index.php> <table> <tr> <td><label
I have form created by the admin generator in the backend of a website.
I have form that uploads file's perfectly, with a post-page-refresh-form. However I have ajaxiefied
I have form for file uploading in my website that i check mime-type of
I have form where user submits field. Field can have letters, numbers, and punctuation.
I have form like this: <div class=satu> <input type='text' size='1' maxlength='1' name='score[1][]' id='score[1][]'> </div>
I have form like this : <div id='add_field' class='locbutton'><a href='#' title='Add'>Add</a></div> <div id='remove_field' class='locbutton2'><a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.