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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:51:25+00:00 2026-05-31T20:51:25+00:00

Alright, so I’m making a form validation everything is good in this JS, but

  • 0

Alright, so I’m making a form validation everything is good in this JS, but now I’m facing a problem in the output, I am trying to display all the chosen data. So I used the action attribute and called the following function:

function funcs()
    {
    var favor = document.reg.favor[selectedIndex].value; //Select input
    var fname = document.reg.fname.value; // text input
    var lname = document.reg.lname.value; // text input
    var email = document.reg.email.value; // text input
    var pass = document.password.value; //text input
    for(i=0;i<document.reg.rad.length;i++)
        {
            if(document.reg.rad[i].checked == true)
            {
                var rad = document.reg.rad[i].value; // Radio input
            }
        }
    if(document.reg.bike.checked == true)
        {
            var bike =  document.reg.bike.value; //CheckBox input
        }
    if(document.reg.car.checked == true)
        {
            var car = document.reg.car.value; //CheckBox input
        }
    document.write('<head><link type="text/css" rel="stylesheet" href="registrationtable.css"/></head><body>');
    document.write("<div class = 'team'>");
    document.write('<table>');
    document.write("<tr><td> שם  פרטי: </td><td>" + fname + "</td></tr> <tr><td> שם משפחה: " + lname + "</td></tr> <tr><td> אימייל: " + email + "</td></tr> <tr><td> סיסמא: " +pass +"</td></tr>");
    document.write("<tr><td> השחקן האהוב עליך הוא " + favor +"</td></tr>"); 
    document.write("</table>");
    document.write("</div></body>");
    }

Here’s the form header:

<form name ="reg" action ="Javascript:funcs()" onsubmit ="return checkValidation()">

I’d like to clear that all the other javascript code is working perfectly, it must be something with this function.
When I’m pressing the send button, it won’t do anything. Anyone knows whats the problem?
Thanks in advanced.

  • 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-31T20:51:27+00:00Added an answer on May 31, 2026 at 8:51 pm

    As I suspected. One problem is this line:

    var favor = document.reg.favor[selectedIndex].value;
    

    It should be

    var favor = document.reg.favor[document.reg.favor.selectedIndex].value;
    

    And your second problem is this:

    var pass = document.password.value;
    

    Should be:

    var pass = document.reg.password.value;
    

    See updated fiddle: http://jsfiddle.net/x7SBy/1/

    Finally, you should use Firefox and download Firebug. It is invaluable for debugging JS problems like this.

    Edit: There are other problems with your JS that I won’t get into in detail, but in general you don’t want to use document.reg.password, because of issues like this. You should really use document.getElementById. FYI.

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

Sidebar

Related Questions

Alright, here is my problem i'm trying to solve. I have an index page
Alright I'm pretty new to programming and stuff and I'm now trying to code
Alright, I know I've asked similar questions, but I feel this is hopefully a
Alright, I'm trying to use the basic document.getElementsByTagName function, but each time I do,
Alright I am trying to set up an OAuth Provider in PHP, but I
Alright, I am trying to accomplish this: When a user clicks a button that
Alright, I'm trying to figure out why I can't understand how to do this
Alright, I know this question has been asked before, but mine has a different
Alright I know this is more than likely a amateur question but I have
Alright, I'm trying to read a comma delimited file and then put that into

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.