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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:51:16+00:00 2026-06-03T14:51:16+00:00

I have a page which contain a bunch of text area generated by a

  • 0

I have a page which contain a bunch of text area generated by a PHP script. There is a hidden input type that contains an id of a variable. Basically what I want to do is to call the .ajax() JQuery method on .blur() on any of the text areas and pass the value of the textarea + the id from the hidden input.
All of my text areas are named like this: tr1,tr2,tr3,etc. And the hidden fields:tr_id1,tr_id2,etc

So how can I get the value from both elements so I can use them somewhere else?

  • 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-03T14:51:18+00:00Added an answer on June 3, 2026 at 2:51 pm

    This may give you an idea

    HTML

    <textarea name="tr1"></textarea>
    <input type="hidden" name="tr_id1" value="1" />
    <br />
    <textarea name="tr2"></textarea>
    <input type="hidden" name="tr_id2" value="2"/>
    

    ​
    JS

    ​$(function(){
        $('textarea').on('blur', function(e){
            var txtAval=$(this).val();
            var txtId=$(this).prop('name').replace('tr','');
            var txtHval=$('input:hidden[name="tr_id'+txtId+'"]').val();
    
            // txtAval contains textarea's value and txtHval contains text input's value
    
           $.ajax({
               type: "POST",
               url: "some_url",
               data: {txtarea:txtAval, txthidden:txtId}
              //or
              //data: "txtarea="+txtAval+"&txthidden="+txtId
            }).done(function(msg) {
                // ...
            });
        });
    });​
    

    jQuery ajax reference: Here.

    See the values on the console here.

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

Sidebar

Related Questions

I have a page which contains a html.RenderPartial, that renders an ASP.NET MVC partial
I have a page which contains a dynamically generated grid, where a user can
I have this html page which is very simple, it contains a text box
I'm pretty new to PHP and have a String which contains an HTML page.
We have a long page that contains a bunch of different form elements. One
I have a page which contain six js included,when the page run about more
Okay, here is my situation. I have a page, index.php, which is the mainsite
I have a page which has DIVs which contain short phrases (one-two words) of
I have a page which will contain 4 static divs with IDs. I will
Everybody, I have a one HTML page which contain one Javascript function which shows

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.