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 ...