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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:16:57+00:00 2026-05-28T01:16:57+00:00

I’ve racked my brains and went through it, looking at examples and don’t understand

  • 0

I’ve racked my brains and went through it, looking at examples and don’t understand why firebug is throwing “e.nodeName is undefined” error..

It’s probably something stupid little bracket out of place or something that needs a second pair of eyes to see..

I’m just making a simple little ajax post for some inputs, but this is my first post ever, and I’m about close to pulling some hair off my head due to how many errors i’ve run into so far..
http://jsfiddle.net/JohnnyDoe/aQYra/

My script

<script type="text/javascript">
    $(document).ready(function () {
        $('.hexen').after('<div class="ui-state-default ui-corner-all ui-icon-disk ui-icon saveButton" onClick="save();" title="Save" style="float:left; height:20px;" onclick="save()"></div><br />') // ui icon
    .keypress(function () {
        $(this).next('.saveButton').show(); //appends ui icon
    });

        $('.saveButton').hide().click(function () {
            $(this).hide(); // removes ui icon on click
        });

        $('.ui-state-default').hover(

    function () {
        $(this).addClass('ui-state-hover');
    }, function () {
        $(this).removeClass('ui-state-hover');
    } //ui icon hover
    );
    });

    function save(value) {
        $('.hexen').each(function () {
            var id = null;
        });
        if ($(this).val() !== '') {
            id = $(this).attr('id');
        }
    }
    $.ajax({
        type: "POST",
        url: "Default.aspx",
        data: "{Id: " + $(".hexen").attr('id') + ", Value: " + $(".hexen").val() + "}",
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            console.log(data);
        }
    });
</script> 

My HTML

<div id="unvolitive">
<input type="text" class="hexen" id="Text1"/>
<input type="text" class="hexen" id="Text2"/>
<input type="text" class="hexen" id="Text3"/>
<input type="text" class="hexen" id="Text4"/>
<input type="text" class="hexen" id="Text5"/>
</div> 

Thanks in advance

  • 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-28T01:16:58+00:00Added an answer on May 28, 2026 at 1:16 am

    I think, from a brief fiddle test, that the issue comes from mixing normal jQuery event handlers and the onclick handler you’re defining in the tag string (your save function).

    I’m not sure what you’re trying to do in save; the each call does nothing:

    $('.hexen').each(function () {
        var id = null; // all this does is set a local variable
    });
    

    but more importantly, the way you’ve set this up with onclick, this will be undefined, so the following line won’t work:

    if ($(this).val() !== '') {
    

    In this context, this refers to the window object, so I think that’s why you’re getting the error. To fix it, you should handle the save function in the jQuery-assigned click handler:

    $('.saveButton').hide()
        .click(function () {
            $(this).hide(); // removes ui icon on click
            var id;
            // get the associated input
            var $input = $(this).prev('.hexen');
            if ($input.val() !== '') {
                id = $input.attr('id');
            }
            console.log(id);
            // presumably, do something with id now...
    });
    

    See a working fiddle.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.