Reputation: 11
Need help! I am trying to open MWO form (../forms/mwo.php) in a modal window after a onclick event. When i click the button i get nothing...not even errors.
<a id="newMWO" name="newMWO" data-role="button" data-inline="true" target="_blank" onclick=getWOCnt()>
New Work Order
</a>
<div id="mwoForm" title="MWO Form"></div>
$(function ()
{
$(".newMWO").on('click', (function (event)
{
event.preventDefault();
var loadVars=(encodeURI("../forms/MWO.php?a=<?php echo $_REQUEST['a']?>"));
var dialogName= $("#mwoForm").load(loadLVars);
$(dialogName).dialog({
autoOpen: false,
resizable: true,
modal: true,
bigframe: true,
height: 600,
width: 1000,
overflow: scroll,
resizable: true,
title: "MWO New Work Order"
});
dialogName.dialog('open');
return false;
}));
});
Upvotes: 1
Views: 848
Reputation: 40639
Use #
in place of .
in your anchor tag selector
like $("#newMWO")
in place of $(".newMWO")
or add class
to your anchor tag
<a id="newMWO" name="newMWO" class="newMWO" data-role="button"
data-inline="true" target="_blank" onclick=getWOCnt()>
New Work Order
</a>
Upvotes: 1
Reputation: 388316
Your selector $(".newMWO")
is wrong it should be $("#newMWO")
. newMWO
is not a class attribute value, it is the id of the element, so you need to use id-selector instead of class-selector
$(function() {
$(".newMWO").on('click', function(event) {
event.preventDefault();
var loadVars = (encodeURI("../forms/MWO.php?a=<?php echo $_REQUEST['a']?>"));
var dialogName = $("#mwoForm").load(loadLVars);
$(dialogName).dialog({
autoOpen : false,
resizable : true,
modal : true,
bigframe : true,
height : 600,
width : 1000,
overflow : scroll,
resizable : true,
title : "MWO New Work Order"
});
dialogName.dialog('open');
return false;
});
});
Upvotes: 0