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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:41:36+00:00 2026-06-06T12:41:36+00:00

Afternoon, I am setting the ID’s for a multiple text boxes in my code

  • 0

Afternoon,

I am setting the ID’s for a multiple text boxes in my code for items returned from the database.
For example…

<input type="text" id="abcd1234" value="0.00">

basically the id is set when the items are returned, i need to get the id using jQuery so i can then update the value within the textbox with a new price.

I need to return 1) the id, and 2) the value so i can then process it. Could any one suggest how i could do this please?

UPDATE: This is the update function i am looking to use… please ignore the data being passed over cause i will update this once i am able to get the price from the textbox mentioned above. – removed the data. 🙂

$('.update').live('click', function () {
    $('#saving').show();


    $.ajax({ type: "POST",
        url: "../Web.asmx/UpdateData",
        data: **JSON will go here**,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (response) {
            $('#saving').hide();
            $('#infoMsg').show();
            $('#infoMsg').addClass('er-green');
            $('#infoMsg').html("Product was updated successfully.");
        },
        error: function (msg) {
            $('#saving').hide();
            $('#infoMsg').show();
            $('#infoMsg').addClass('er-yellow');
            $('#infoMsg').html("We are unable to update the product at this time.");
        }
    });
});

Many thanks…

Alan

  • 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-06T12:41:38+00:00Added an answer on June 6, 2026 at 12:41 pm

    Not sure which event you want the ID of the input element. The below script will give you the ID of all Input element of type text once the DOM is loaded

    $(function(){
    
      var items=$("input[type='text']");
      $.each(items,function(){
        var item=$(this);
    
        var itemId=item.attr("id");  // get the ID of element
        alert(itemId);
    
        item.val("New value");  // set new value
      });
    
    });
    

    Working sample http://jsfiddle.net/p5zbT/4/

    EDIT : as per the comment

    To get he textboes belongs to one table, change your selector like this

     var items=$("#dataTable input[type='text']");
    

    This will select the input elements of type text inside a table(or any HTML element) with ID value as dataTable.

    Working Sample : http://jsfiddle.net/p5zbT/9/

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

Sidebar

Related Questions

Afternoon All, I have a dropdown list which extracts data from my SQL database
Afternoon guys, I'm using a SOLR index for searching through items on my site.
Good Afternoon, I am having a hard time setting the navigational links to active
Afternoon All, I have a stored procedure in an SQL 2005 database named GasNominationsRawData_Insert.
Whole afternoon I am struggling with the getting data from associations. I have these
Afternoon All, I have a simple gridview with list items items that have been
Afternoon all, In need of some technical advice from the masters... I know the
Good afternoon, I am using the code below to map a network drive in
Afternoon All I have some data - var searchwithin = [ {id:clearwithin, type:button}, {id:search_radius,
Afternoon all. A very simple one for you today from thicky Rich. I have

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.