caracarogna Posted March 26, 2013 Share Posted March 26, 2013 I'm using php but to open modal popup I'm using leanModal (jquery). More or less the code to open the modal window is the follow: <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script type="text/javascript" src="./Js/jquery.leanModal.min.js"></script> <script> $(function() { $('a[rel*=leanModal]').leanModal({ top : 200, closeButton: ".modal_close" }); }); </script> <style> #lean_overlay { position: fixed; z-index:100; top: 0px; left: 0px; height:100%; width:100%; background: #000; display: none; } </style> </head> <body> <a id='go' href='#register' name='registrazione' rel='leanModal'>Registrazione</a> <?php echo "<div id='register' class='moddiv' style='display: none; '> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum. Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum odio, ac blandit ante orci ut diam. Cras fringilla magna. Phasellus suscipit, leo a </div>"; ?> </body> It's work fine but I need to insert in the popup some more info... I'd like to pass via querystring a value in order to use it in my modal window ... I've try with the following modification: <a id='go' href='?Value=123456#register' name='registrazione' rel='leanModal'>Registrazione</a> <?php echo "<div id='register' class='moddiv' style='display: none; '> $_POST['Value'] Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum. Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum odio, ac blandit ante orci ut diam. Cras fringilla magna. Phasellus suscipit, leo a </div>"; ?> But it's not working, adding "?Value=123456" the leanmodal fail ... The question is: It is possible pass some value to a leanmodal popup? Maybe there is a PHP native way to open modal popup but I don't know how ... Quote Link to comment https://forums.phpfreaks.com/topic/276157-php-and-leanmodal-jquery/ Share on other sites More sharing options...
haku Posted March 26, 2013 Share Posted March 26, 2013 Add either a path, or the full URL as the href to the <a> tag. It's almost guaranteed that the plugin is using the value in the href as the source of the contents for the window, and your query string alone isn't enough information to be able to do that. Quote Link to comment https://forums.phpfreaks.com/topic/276157-php-and-leanmodal-jquery/#findComment-1421060 Share on other sites More sharing options...
caracarogna Posted March 26, 2013 Author Share Posted March 26, 2013 Well seems to work only when just the anchor (#register) it's specified in the Href tag; each time I add something more, full path or variable, the text (I mean the DIV) it's not displayed ... Quote Link to comment https://forums.phpfreaks.com/topic/276157-php-and-leanmodal-jquery/#findComment-1421193 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.