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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:06:21+00:00 2026-05-26T05:06:21+00:00

I have a dynamic listing of products pulling from a MySQL Database. On the

  • 0

I have a dynamic listing of products pulling from a MySQL Database. On the listing there is a Contact Now button which I am using a jquery Modal script for which pops up with a form.

My problem is trying to pass the product information variables to that popup.

I was thinking of adding the Brand and Model name using the rel attribue like this:

<a href="#" class="contact_now" rel="<?=$sku_brandname;?> <?=$sku_modelname;?>">Contact Now!</a>

and then with Javascript I can do this:

    $(".contact_now").click(function(){

    var rel = $(this).attr('rel');
    alert(rel);

which works perfect but on my Popup Div I’m not sure how to get that javascript rel variable to output it.

<p>Fill out the form below to inquire about the <strong>{ rel value here }</strong>.  We will get back to you as soon as possible.</p>

I’m not sure how to do this. If anyone has any ideas or suggestions I would appreciate it.

Thanks!

  • 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-26T05:06:21+00:00Added an answer on May 26, 2026 at 5:06 am

    Few things. First of all, if you want to store data in some nodes, you’re better off using data attributes, like this:

    <a href="#" class="contact_now" data-brand-name="<?=$sku_brandname;?>" data=-model-name="<?=$sku_modelname;?>">Contact</a>
    

    You can then use jQuery to get them like this:

    $(this).data("brandName");
    

    As for the sending the variable to PHP thing, you should instead modify the value with JavaScript when you open the popup. (If it’s not on the same page, say that in the comment.). To do that, you can give a span a class and modify it before showing the popup.

    <p>Fill out the form below to inquire about the <span class="product"></span> We'll get back to you ASAP.</p>
    

    Then in jQuery:

    $(".product").text($(this).data("brandName"));
    //Show popup
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic listing of products which is being pulled from a MySQL
I have dynamic array filled with bytes, which are read from .raw file with
I have a dynamic text file that picks content from a database according to
I have dynamic page. There are multiple checkboxes & I am using this script
I have dynamic web page with JS. There is a <textarea> and a Send
I have a dynamic web project in eclipse, which uses annotations to map servlets
I have implemented a custom route (inherit from RouteBase) to have dynamic routes based
I'm building an application which will have dynamic allocated objects of type A each
I have a list which contains dynamic data. i.e list[0].id=0; list[1].id=1; list[2].id=2; I want
I have a select which needs to have dynamic WHERE CASE conditions. SELECT *

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.