Search code examples
phpfancybox

fancybox with drop-down list option pre-selected


This is my fancybox initiation:

$("a.appointment_button").fancybox({
	'type': 'iframe',
	'width': 400,
	'padding': 0,
	'scrolling': 'no',
	'closeBtn': true,
	'autoScale': false
});

I'm trying to get drop-down list option pre-selected in my fancybox for different buttons.

So for instance: when number 1 button is clicked I want option 1 of the drop-down list to be pre-selected or when number 2 button is clicked I want option 2 of the drop-down list to be pre-selected when the fancybox loads.

Could you please advice?


Solution

  • You really did not give any useful info, for example, what and how are you trying to display in fancybox - is it html, inline content, ajax or iframe?

    If you are displaying inline content (for example, a hidden form), then you do not need to do anything related to fancybox, all changes will be "live" and your content will keep all changes after opening/closing fancybox.

    If you are using iframes, then the easiest solution would be to use url parameters, for example, appointment.php?selected_id=1