Reputation: 5654
I have a href tag and i am calling a form in fancybox. This is how its done;
<a class="fancybox fancybox.iframe" caption ="Registration" href="registration.htm">Registration</a>
When the user clicks on the link the page opens in fancybox. I have now implemented a jquery dialog with buttons and i am attempting to call the registration page just as above when the user clicks on a button in the dialog box. How can this be achieved? This is what i have thus far:
Jquery Dialog:
$( "#userOptions-dialog" ).dialog({
autoOpen: false,
height: 100,
width: 380,
resizable:false,
modal: true,
buttons: {
"Cancel": function() {$( this ).dialog( "close" );},
"Register": function() {
//how can i call the href tag here
}
});
Upvotes: 0
Views: 166
Reputation: 5654
This worked for me added css to hide the link and used simple javascript call to click on the link.
html
<a id = "registration" class="fancybox fancybox.iframe" caption ="Registration" href="registration.htm">Registration</a>
css
#registration{
display:none;
}
jquery
$( "#userOptions-dialog" ).dialog({
autoOpen: false,
height: 100,
width: 380,
resizable:false,
modal: true,
buttons: {
"Cancel": function() {$( this ).dialog( "close" );},
"Register": function() {
$("#registration").click();
}
});
Upvotes: 1