tebrown Posted September 10, 2012 Author Share Posted September 10, 2012 Thanks. It doesn't seem to open up the modal though. jQuery(function ($) { $('#basic-modal .basic').click(function (ev) { ev.preventDefault(); $('<div />').load($(this).attr('href')).modal(); }); }); }); Quote Link to comment https://forums.phpfreaks.com/topic/268174-passing-variables-into-modal-dialoguewindow/page/2/#findComment-1376622 Share on other sites More sharing options...
darkfreaks Posted September 10, 2012 Share Posted September 10, 2012 i really don't think it is the JS though. try changing the loop a few time as follows tell me what you get. while($rows=mysql_fetch_array($result,MYSQL_NUM) { //output as numerical index } while($rows=mysql_fetch_array($result,MYSQL_ASSOC) { //output as associative index } while($rows=mysql_fetch_array($result,MYSQL_BOTH) { //output both assoc and numerical index } Quote Link to comment https://forums.phpfreaks.com/topic/268174-passing-variables-into-modal-dialoguewindow/page/2/#findComment-1376624 Share on other sites More sharing options...
darkfreaks Posted September 10, 2012 Share Posted September 10, 2012 not entirely sure but it might have to do with using $_SESSION over $_GET Quote Link to comment https://forums.phpfreaks.com/topic/268174-passing-variables-into-modal-dialoguewindow/page/2/#findComment-1376633 Share on other sites More sharing options...
tebrown Posted September 10, 2012 Author Share Posted September 10, 2012 I played around with it for a while but easnt working still. I then looked into this forum post: http://stackoverflow.com/questions/8585361/jquery-dialog-box-passing-variable-value-from-php-to-jquery-function So i tried out the iFrame, i got it to work and it now shoes the id for each link. But iFrame's seem to take away my css styling. I've lost all my style within the modal itself. jQuery(function ($) { // Load dialog on click $('#basic-modal .basic').click(function (e) { e.preventDefault(); // Display an external page using an iframe var src = $(this).attr('href'); $.modal('<iframe src="' + src + '" height="450" width="400" style="border:0">', { overlayClose:true }); return false; // not sure why you're doing this }); // end of click handler }); // end of document.ready Quote Link to comment https://forums.phpfreaks.com/topic/268174-passing-variables-into-modal-dialoguewindow/page/2/#findComment-1376635 Share on other sites More sharing options...
tebrown Posted September 10, 2012 Author Share Posted September 10, 2012 Ok i found a solution but i'm not sure how safe in regards to coding standards. jQuery(function ($) { // Load dialog on click $('.basic').click(function (e) { var id = $(this).attr("href"); $('#showvalue').text(id) $('#content-one').modal({ overlayClose:true, opacity:40 }); return false; }); }); When the user clicks a specific fixture from the list, it will open the modal and then show the id number within the div 'showvalue'. To echo it out i did the following. $id = '<div id="showvalue"></div>'; echo $id; Tell me what you think. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/268174-passing-variables-into-modal-dialoguewindow/page/2/#findComment-1376647 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.