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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:13:35+00:00 2026-06-15T22:13:35+00:00

This may be simple, or impossible, but either way, I want to pass a

  • 0

This may be simple, or impossible, but either way, I want to pass a table row name to a modal dialog form via jquery.

$('.activate_modal').click(function(){

            var rowid = $(this).attr('name');

            $( "#dialog-form" ).dialog( "open" );

        });

I am dynamically creating rows via PHP, and on click opens a jquery modal window, I need to pass an id (the var rowid) to the form so it knows what rows is calling the function. is this possible?

  • 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-15T22:13:37+00:00Added an answer on June 15, 2026 at 10:13 pm

    You can use jQuery’s data() method for this.

    i.e.

    var rowid = $(this).attr('name');
    $( "#dialog-form" ).data('rowID', rowid); // set the data to be passed
    $( "#dialog-form" ).dialog( "open" );
    

    And when you need to access the value, you can access it like:

    var passedInRowId = $( "#dialog-form" ).data('rowID'); // get the data that was passed
    

    For filling in a form field that appears inside the popup.

    var rowid = $(this).attr(‘name’);
    $( “#dialog-form” ).data(‘rowID’, rowid); // set the data to be passed

    // fill it in here before diaplaying the dialog
    // NOTE: if this is the only place you need the rowid on, you dont need to use data() at all
    $(‘#yourformfield’).val(rowid);

    $( “#dialog-form” ).dialog( “open” );

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

Sidebar

Related Questions

this may be stupidly simple but I'm trying to figure out a way to
This may be a simple question but I can;t find the answer anywhere. Here
This may be a simple fix and maybe I'm missing something obvious, but when
This may well be simple, but I'm new to Drupal. The organization I work
This may be very simple question,But please help me. i wanted to know what
This may be a simple answer, but I'm trying to add a dom-created element
This may be super simple - but I'm struggling to spot what's going on.
Okay this may be a simple question but I have yet to come with
This may be simple but it confuses me. int x; int *p = NULL;
I expect there's one of two answers to this, either impossible or extremely simple

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.