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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:19:25+00:00 2026-06-01T11:19:25+00:00

This is the fragment of code inserted with ajax: <form> <label for = task-name>Name</label>

  • 0

This is the fragment of code inserted with ajax:

<form>
    <label for = "task-name">Name</label>
    <input type = "text" id = "task-name" />

    <label for = "task-description">Description</label>
    <input type = "text" id = "task-description" />

    <input type = "hidden" id = "task-col" />
    <input type = "hidden" id = "task-row" />

    <input type = "submit" id = "add-task" onclick="return false" value="Add" />

</form>

This is the JS code which insert the previous element in the DOM:

$('html').on('click', '.task-pop', function(){
    var pos = $(this).parent().parent().attr('class').split("-");
    ajaxObj = getXmlHttpObject();
    ajaxObj.onreadystatechange = function(){
        if(ajaxObj.readyState == 4 && ajaxObj.status == 200){
            $('#pop-hold').html(ajaxObj.responseText);
            $('#task-col').val(pos[0]);
            $('#task-row').val(pos[1]);
        }
    };
    ajaxObj.open("GET","resources/component/newTask.jsp");
    ajaxObj.send(null);

    $('#pop-blk').css('display','block');
    $('#pop').show("fast");
});

As you can see I’m trying to add some values to the hidden inputs #task-row and #task-col from the content added dynamically.

The page is properly displayed and no error is thrown but those two fields are never accessed. How can I solve this?

  • 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-01T11:19:26+00:00Added an answer on June 1, 2026 at 11:19 am

    change

    $('#pop-hold').html(ajaxObj.responseText);
    $('#task-col').val(pos[0]);
    $('#task-row').val(pos[1]);
    

    with

    var html = $(ajaxObj.responseText);
    html.find('#task-col').val(pos[0]);
    html.find('#task-row').val(pos[1]);
    $('#pop-hold').html('').append(html);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In this code fragment foreach (var row in grid.Rows) { } the type of
With this code fragment, I would expect the label to have a background color
In this code fragment, which constructor is actually called? Vector v = getVector(); Vector
When I run this code fragment, neither side is taken. if (Boolean.class.isAssignableFrom(boolean.class)) { uLog.error(Boolean
In a code review, I stumbled over this (simplified) code fragment to unregister an
For the following code fragment. /*This program demonstartes how a virtual table pointer *
Say I have this HTML fragment <td width=25% style=text-align:right; > <span style=font-family: Arial; font-size:
Consider this code fragment; int sum = 0; sum = Expression.Evaluate(1+1); where the value
I have this code fragment: public static class ExportDatabaseFileTask extends AsyncTask<String, Void, Boolean> {
I have this code fragment int i = 5; int k = 7; int

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.