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 7781079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:06:37+00:00 2026-06-01T19:06:37+00:00

This is my try at creating a registration page however after the for loop

  • 0

This is my try at creating a registration page however after the for loop whatever follows does not execute and I’m at a loss as to why?
Below is the javascript code and the form

<script type='text/javascript'>
myArray = ['username','email','password','password2'];
reply = ['User Name','Email','Password','Password Again'];
message = "Please Type you're ";
start = "<font color = red size='-1'>";
end = "</font>";
test = 10;
obj = validate();
alert (obj);
function validate(){

for (var i=0; i<=myArray.length; i++) {
               if (document.getElementById("in"+myArray[i]).value == "")
               {
                   document.getElementById(myArray[i]).innerHTML = start+message+reply[i]+end;
                   test = 30;
               }
                }
alert ("test");
}

<form action="echo.php" method="post" name="register" onsubmit="return validate();">
<table>
    <tr>
      <td width="185"><font size="2">First Name</font></td>
      <td width="499">
        <input id = "infirst_name" name="first_name" type="text" /><div id="first_name"></div></td>
    </tr>
    <tr>
      <td><font size="2">Last Name</font></td>
      <td><input id = "inlast_name" name="last_name" type="text" /><div id="last_name"></font></div></td>
    </tr>
    <tr>
      <td><font size="2">Username*</font></td>
      <td>
        <input id = "inusername" name="username" type="text" /><div id="username"></div></td>
    </tr>
    <tr>
      <td><font size="2">Email*</font></td>
      <td><input id = "inemail" name="email" type="text" /><div id="email"></div></td>
    </tr>
    <tr>
      <td><font size="2">Password*</font></td>
      <td><input id = "inpassword" name="password" type="password" /><div id="password"></div></td>
    </tr>
    <tr>
      <td><font size="2">Repeat Password*</font></td>
      <td>
        <input id = "inpassword2" name="password2" type="password" /><div id="password2"></div></td>
    </tr>
    <tr>
    <tr>
      <td><font size="2">I have read and Agree to the Terms and Conditions</font></td>
      <td>
        <input id = "incheckme" name="checkme" type="checkbox" /><div id="checkme"></div></td>
    </tr>
    <tr>
      <td><input type="submit" value="Register" /></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
  • 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-06-01T19:06:39+00:00Added an answer on June 1, 2026 at 7:06 pm

    Try fixing your loop:

    for (var i=0; i < myArray.length; i++) {
    

    JavaScript will stop executing anything if it encounters an uncaught error. In your case it seems that you’ve looped past the last element (and tried to set innerHTML on an undefined object).

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

Sidebar

Related Questions

I am creating a database like this : SQLiteDatabase db = openOrCreateDatabase(mydata.db,SQLiteDatabase.CREATE_IF_NECESSARY,null); try {
please try this link for getting my code. its working in all browsers not
I tried to do this: try{ (function($){ ... my plugin stuff })(jQuery); }catch(er){ alert(an
I am currently using code similar to this: try { // IE ONLY var
I saw some code like this: try { db.store(mydata); } finally { db.cleanup(); }
Often I find myself coming across code like this: try { StreamWriter strw =
I am trying to get twitter updates like this: try { $doc = new
When parsing an xml file in android, I'm doing like this: try { InputStream
I try this command to upload a file (standard.xml) into table book the file
I try this with NetBeans desktop application template - increasing heapsize (to 512 MiB)

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.