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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:54:27+00:00 2026-06-03T13:54:27+00:00

Apologies for the unweildy title, this is a very difficult question to put into

  • 0

Apologies for the unweildy title, this is a very difficult question to put into words. This code will explain it much better.

alert(formob.Nam.value); //i work correctly
alert(formob.Num.value); //and me  

name=formob.Nam; 
console.log(name); //[object HTMLInputElement]
console.log("name set "+name.value); //i return 'name set undefined'

num=formob.Num;
console.log(num); //<input type="text" name="Num">
console.log("num set "+num.value); //i return 'num set [value entered]' correctly

Simplified HTML:

<form method="post" class="well" name="FooterCall">
<input type="text" name="Nam">
<input type="text" name="Num">
<button... onmousedown="subajax(this.form...)"..>

Summary:
Two essentially identical fields are being set in a form, but one sets incorrectly when the field is set to a Javascript object.

Thankyou very much in advance for any help that can be offered! 🙂

  • 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-03T13:54:29+00:00Added an answer on June 3, 2026 at 1:54 pm

    if you use the following HTML

    <form method="post" name="formob">
    <input type="text" name="Nam">
    <input type="text" name="Num">
    </form>
    ​
    

    and check this JavaScript where you do not use nameas variable name it should work imho. formob needs to be a reference to the form of course:

    console.log(formob.Nam.value); //i work correctly
    console.log(formob.Num.value); //and me  
    
    xname = formob.Nam;
    console.log(xname); //[object HTMLInputElement]
    console.log("name set " + xname.value); //i return 'name set undefined'
    
    num = formob.Num;
    console.log(num); //<input type="text" name="Num">
    console.log("num set " + num.value); //i return 'num set [value entered]' correctly​
    

    this should work

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

Sidebar

Related Questions

Apologies in advance if this is a silly question, am very much a beginner.
Apologies if this is a very simple question; I don't use XSLT very much
Apologies for the horrible title. I spent 10 minutes trying to explain this in
Apologies in advance for the question title, I can't think of a better way
Apologies if this question has been asked already, but suppose we have this code
Apologies in advance if this becomes a very long question... Background Info I have
Apologies if this is too ignorant a question or has been asked before. A
Apologies if this question is a bit obscure, I've been banging my head against
Apologies for asking what's probably a very obvious question, I've been banging my head
Apologies if this is a dumb question. In previous ASP.NET projects, I've been using

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.