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

  • Home
  • SEARCH
  • 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 6703181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:08:27+00:00 2026-05-26T07:08:27+00:00

Here is my html code with javascript validations…. HTML elements are showing well javascript

  • 0

Here is my html code with javascript validations…. HTML elements are showing well javascript function is not working…..

<html>
 <head>
    <title>SIGNUP</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="style/style.css" rel="stylesheet" type="text/css" />    
    <script type="text/javascript">
        function valid(fname,sname,login,name,tstest,mailf,mails){
var namef=fname.value;
var names=sname.value;
var logn=login.value;
var name1=name.value;
var ts=tstest.value;
var mailf=mail1.value;
var mails=.mail2.value;
if(namef=="")   <!-- validating the field first name-->
{
   window.alert("please enter name.");
   fname.focus();
 }
else if(names=="")<!-- validating the field second name-->
{
  window.alert("please enter password");
 sname.focus();
 }
 else if(names<=6)
     {
  window.alert("Password should be more than 6 characters");
  sname.focus();
  }
 else if(logn=="")<!-- validating the login field-->
 {
   window.alert("please enter email.");
  login.focus();
  }
 else if(name1=="")<!-- validating the password field-->
  {
    window.alert("please enter confirm password.");
      name.focus();
   }
      else if(name1!=names)
    {
     window.alert("Password Mismatch");
        name.focus();
      }
          else if(ts=="")<!-- validating the date field-->
       {
            alert("please enter contact number.");
              tstest.focus();
        }
          else if(ts<10)
         {
       alert("Contact Number Should be Minimum 10 numbers");
       tstest.focus();
          }
             else if(mailf=="")<!-- validating the mail field-->
          {
            alert("please enter qualification.");
               mail1.focus();
          }
          else if(mails=="")<!-- validating the 2nd mail field-->
             {
                alert("please enter interested in.");
     mail2.focus();
     }
      }

        }
    </script>
            </head>
               <body>
              <center>
            <div id="border"><div id="header">
                <div id="logo-bg">
                    <div class="name">Ayansys</div>
                    <div class="tag">COMPANY SLOGAN</div>
                </div>
            </div>
            <div>
                <h1>SIGNUP FORM</h1>
            <form name="sign"                                   onsubmit="valid(fname,sname,login,pwd,tstest,mail1,mail2)" >
                <table name="signuptable">
                    <tr><td>FIRST NAME</td><td><input type="text" name="fname" size="50"/></td></tr>
                    <tr><td>LAST NAME</td><td><input type="text" name="sname" size="50"/></td></tr>
                    <tr><td>DESIRED LOGIN NAME</td><td><input type="text" name="login" size="50"/></td></tr>
                    <tr><td>PASSWORD</td><td><input type="password" name="pwd" size="50"/></td></tr>
                    <tr><td>RE-TYPE PASSWORD</td><td><input type="password" name="repwd" size="50"/></td></tr>
                    <tr><td>GENDER</td><td><input type="radio" name="gender" value="Male"/>Male<input type="radio" name="gender" value="FeMale"/>Female</td></tr>
                    <tr><td>DATE OF BIRTH</td><td><form name="tstest">
                     <input type="text" readonly size="47" name="timestamp" value="">
                                                    <a href="javascript:show_calendar('document.tstest.timestamp', document.tstest.timestamp.value);"><img src="cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a>
                                                    </form></td></tr>
                    <tr><td>MAIL ID</td><td><input type="text" name="mail1" size="30">@<input type="text" name="mail2" size="11"></td></tr>
                    <tr><td>EMPLOYEE ID</td><td><input type="text" name="eid" size="50"></td></tr>
                    <tr><td>TYPE OF USER</td><td><input type="radio" name="manager"/>Manager<input type="radio" name="manager"/>SeniorManager</td></td></tr>
                    <tr><td>ADDRESS</td><td><textarea rows="9" cols="40" name="addr"></textarea></td></tr>
                    <tr><td>MOBILE NUMBER</td><td><input type="text" size="50" name="mobile"></td></tr>
                    <tr><td></td><td><input type="submit" name="sign" value="SUBMIT">&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="cancel" value="CANCEL"/></td></tr>
                </table>
            </div>
            </form>
                </br><div>Designed by:<a href="#">STUDY CENTER</a></div>
          </div>
    </center>
</body>

  • 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-26T07:08:28+00:00Added an answer on May 26, 2026 at 7:08 am

    line 13, you have a “dot”
    mails=.mail2.value;

    line 66 syntax error you had a wrong placed brace

    try removing the dot and the brace and see if it works as expeted

    pulse window.alert() , you only need to use alert()
    and your redeclaring you variables

    your onsubmit argument mail2 differs from the expeted one mails

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's what I'm trying to do, simplified: <input rel=TimeStart> // bunch of HTML code
I'm using an HTML sanitizing whitelist code found here: http://refactormycode.com/codes/333-sanitize-html I needed to add
I am trying to test some of these code here http://ha.ckers.org/xss.html on my code.
Here is my code: $('#right').load('textes.html #nicolas'); $('#right').load('textes.html #antoine'); The problem is that the content
First off here is the code! <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Here is the input (html, not xml): ... html content ... <tag1> content for
I'm guessing that using PHP's header(location: here.html) would be much better javascript's window.location(here.html) as
I'd like to process some html code in javascript, to eliminate all extra whitespace,
please help me select c.. Here's the HTML code: <div id=a> <div id=b></div> <div

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.