Link to home
Start Free TrialLog in
Avatar of jamesdean666
jamesdean666

asked on

ASP.NET / JQUERY - Pass value to dialog

I am a newbie to JQuery.  I have the following code in my global JQuery page - global.js.

$(".documentor").live("click", function () {
            childDialog("/common/HelpfulHints.aspx?q=" + $(this).attr("id"), "Add New Documentation " + " - " + $(this).attr("id").replace("_", " "), 500, 450, parent.main);
            
I want to pass a value from any page the user is currently on (that calls childDialog) to the Dialog page - /common/HelpfulHints.aspx

For example, I would like to pass the value of alert($(this).attr("id")  or escape(document.location.pathname)) to a TextBox (txtHHElementID) on  /common/HelpfulHints.aspx

How is this done?
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

What is the problem?

Looks ok to me except .live() is deprecated.

I would format the code better

$(document).ready(function() {
  $(".documentor").live("click", function () {
    var URL = "/common/HelpfulHints.aspx?q=" + 
       $(this).attr("id"), "Add New Documentation " + 
       " - " + $(this).attr("id").replace("_", " ")
    childDialog(URL , 500, 450, parent.main);
  });
});

Open in new window

SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jamesdean666
jamesdean666

ASKER

Thanks.