[solved] how to open a colorbox modal window containing content from a database?
[solved] how to open a colorbox modal window containing content from a database?
rw1
Posts: 42Questions: 0Answers: 0
hello,
i have a link in a datatables table (using the server-side example) that when clicked on i want to:
- open the colorbox modal window
- display the content (text) from the database in the modal window
i was achieving this before with the colorbox 'inline' class and hidden div solution when i was using datatables with no server side processing (ie just an html table).
it seems i cannot use this solution now though because if i add this code to the database:
[code]
link
text title
"text goes here". [link]
[/code]
it just displays the link and does not pop up the colorbox modal when clicked or know how to find the hidden div.
any help much appreciated!
thanks!
i have a link in a datatables table (using the server-side example) that when clicked on i want to:
- open the colorbox modal window
- display the content (text) from the database in the modal window
i was achieving this before with the colorbox 'inline' class and hidden div solution when i was using datatables with no server side processing (ie just an html table).
it seems i cannot use this solution now though because if i add this code to the database:
[code]
link
text title
"text goes here". [link]
[/code]
it just displays the link and does not pop up the colorbox modal when clicked or know how to find the hidden div.
any help much appreciated!
thanks!
This discussion has been closed.
Replies
[code]
// Called directly with HTML
$.colorbox({html:"Welcome"});
[/code]
could anyone please tell me:
- what would i need to put in the head area of the html document?
- what would i need to put in the database table?
so that the link pops up the html content defined.
my only guesses so far are something like this in the html document head area:
[code]
$(".test").colorbox({html:"Welcome"});
[/code]
and then this is the database:
[code]
link
[/code]
but that is not working - any help appreciated!
thank you!
this works when added to the database table (ie the link opens in a colorbox - woo hoo!).
[code]
link
[/code]
i just need to know how to add styling to that instance of the colorbox now!
any ideas?
thanks!
[code]
link in the datatables table
[/code]
edit: note the styling applied to the colorbox is 50% width and 100px from the top of the page.