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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:52:48+00:00 2026-06-13T03:52:48+00:00

I found on some examples on the web that people were passing the form

  • 0

I found on some examples on the web that people were passing the form to a function and then they were only using the id of the item to access it like in :

<form id="frm">
<input type="text" id="textbox" name="textbox" value="some value" />
</form>

<script>
console.log(getelementval("#frm"));

function getelementval(frm) {
return frm.textbox.val();
}
</script>

But FireBug tells me that frm.textbox is undefined… Then I’m searching why it doesn’t work on the net but I didn’t find anything explaining this option and how to use it.
Any clues?

  • 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-13T03:52:49+00:00Added an answer on June 13, 2026 at 3:52 am

    You will have to modify the JS slightly to make this work:

    function getelementval(frm) {
        return $(frm)[0].textbox.value;
    }
    

    Demo: http://jsfiddle.net/gdZEK/2/

    • $(frm) returns an element matching the selector.
    • [0] fetches the actual DOM element.
    • .textbox works on DOM elements only, not jQuery objects. It matches [name='textbox'].
    • .value needs to be used instead of .val(), as .textbox isn’t a jQuery object.

    Honestly, I don’t really see how this is better than just using jQuery:

    $('#frm input[name="textbox"]').val();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found some examples of .AVI in html on the web. But my page
I read some XSLT examples and found that code: <xsl:apply-template select=@*|node()/> What does that
I have looked over the web and found some cool examples of MVC implementation
I've searched for an answer and found some c#-examples, but could not get this
I have done some research, and majority of the examples I have found use
I got problem with sending data in Android using httpPost. I found some example,
I found many different views on many articles on presentation tags, with some people
I have a .net web service that takes some xml data. From within the
Found this is some example CSS I was reading and I'm having a hard
Example: We found this is some vendor written code and we're trying to figure

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.