I have this jQuery function:
$('#invite_friends_email').live('click' , function()
{
$("#invite_friends_email").dialog();
return false;
});
and on that page I import that div like this:
<?php
include '../divs/invite_frineds_by_email.php';
?>
and the div itself looks like this:
<div id="invite_friends_email" style="display: none;">
<form method="post" action="">
<p>
<br />
<h3>Enter Your Friends Email Addresses (Separated by Comma)</h3>
<textarea type="textarea" rows="2" cols="75" name="emails"></textarea>
</p>
<p>
<strong><h3>Email Subject (Edit subject to add your name so your friends recognize you)</h3></strong>
<input type="text" name="subject" size="75" value="Your friend wants to invite you to brainstorm problem solutions">
</p>
<p>
<h3>Enter Your Message: (Edit the body of the text however you like)</h3>
<textarea type="textarea" rows="5" cols="75" name="message">Here is the URL of the problem:
http://www.problemio.com/problems/problem.php?problem_id=<?php echo $problem_id; ?>
</textarea>
</p>
<p>
<input type="submit" style="border: none;" alt="Send email!" />
</p>
</form>
</div>
You can reproduce the current problem by going here:
http://www.problemio.com/problems/problem.php?problem_id=225 and clicking on the “Invite Friend(s) via Email” link. Right now I can tell that the click function is being called, but not sure why the dialog is not popping up. Any idea how to make it come up?
Two things could be the issue.
Your div and your invite friends link have the same id so using the
#invite_friends_emailselector may return the a tag first. As it will only return the first result so pot luck if its your a tag or your div.Second I inspected the generated HTML and i can’t see your div anywhere so have a look to see if it’s included correctly.