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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:13:02+00:00 2026-06-11T04:13:02+00:00

I’m creating a simple messaging system (for learning purposes) where a user enters their

  • 0

I’m creating a simple messaging system (for learning purposes) where a user enters their passcode or creates one if they don’t have one and our message correspondence is stored in an array within another array. Example: you’re the 5th user to register, your passcode is the the 5th item in the pass array, and our correspondence is the the 5th array in the logNum array.

I’m wondering if I can use local storage so users can close their browser and still have our correspondence saved and how I would be able to modify the log. But as of now my confirmation paragraph at the bottom is not even being inserted into the document.

I GREATLY appreciate any advice.

<!DOCTYPE HTML> 
    <html>     
        <head>             
            <title>waGwan?</title>     
            <meta charset="utf-8"/>
            <link rel=stylesheet href=comm.css></link>       
        </head>     
            <body>                              
                <section>
                    <p>enter or create passcode: <input type=text id=passcode></p>
                    <input type=button id="button" value="send">
                </section>
                <section id="log"></section>
                <script type="text/javascript">
                    var pass[];
                    var logNum=[];
                    document.getElementById("button").onclick=checkPass;
                    function checkPass(){
                        for(i=0;i<pass.length;i++){
                            //if passcode already exists exit
                            if(document.getElementById("passcode").value==pass[i]){
                                break;
                            }
                            //if passcode doesn't equal last existing passcode the passcode is added to the pass array and an array with name passcode is added to the logNum array
                            else if(document.getElementById("passcode").value!==pass[pass.length-1]){
                                pass.push(document.getElementById("passcode").value)
                                logNum.push(var document.getElementById("passcode").value.toString()[]);
                            }
                        }
                        //adds "Works!" to document
                        document.getElementById("log").innerHTML="<p>Works!</p>";
                    }
                </script>
            </body> 
    </html>
  • 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-11T04:13:03+00:00Added an answer on June 11, 2026 at 4:13 am

    Some typo’s 😉

    <!DOCTYPE HTML> 
        <html>     
            <head>             
                <title>waGwan?</title>     
                <meta charset="utf-8"/>
                <link rel=stylesheet href=comm.css></link>       
            </head>     
                <body>                              
                    <section>
                        <p>enter or create passcode: <input type=text id=passcode></p>
                        <input type=button id="button" value="send">
                    </section>
                    <section id="log"></section>
                    <script type="text/javascript">
                        var pass=[]; << here
                        var logNum=[];
                        document.getElementById("button").onclick=checkPass;
                        function checkPass(){
                            for(i=0;i<pass.length;i++){
                                //checking if passcode already exists
                                if(document.getElementById("passcode").value==pass[i]){
                                    break;
                                }
                                //if passcode doesn't equal last existing passcode the passcode is added to the pass array and an array with name passcode is added to the logNum array
                                else if(document.getElementById("passcode").value!==pass[pass.length-1]){
                                    pass.push(document.getElementById("passcode").value)
                                    logNum.push(document.getElementById("passcode").value.toString());<< here
                                }
                            }
                            //adds "Works!" to document
                            document.getElementById("log").innerHTML="<p>Works!</p>";
                        }
                    </script>
                </body> 
        </html>
    
    1. var pass = [];

    2. logNum.push(document.getElementById("passcode").value.toString());

    Working jsfiddle

    Try using Firebug for FireFox or another developerstool available for your browser.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am using Paperclip to handle profile photo uploads in my app. They upload

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.