From script tag
$('input[id*=anyTrouble]').click(function () {
alert('trouble has arrived');
var con = $('#myTroubleNote').val();
$("#troubleNote").val(con);
$("#dialog-trouble").dialog("open");
return false;
});
$("#dialog-trouble").dialog({
title: "Trouble Information",
autoOpen: false,
height: 600,
width: 1000,
modal: true,
dialogClass: "no-close",
buttons: {
"Okay": {
class: 'okDialogButton',
text: 'OK',
click: function () {
var bValid = true;
var tType = $("#ddl_TType option:selected").val();
var tModule = $("#ddl_Module option:selected").val();
var thisNote = $('#troubleNote');
var notelength = thisNote.val();
bValid = bValid && checkLength(thisNote, "TroubleNote", 3, 2048);
bValid = bValid && (notelength.length > 2);
if (bValid) {
$('#myTroubleNote').val(thisNote.val());
$('#myTroubleNote').change();
$('#myType').val(tType);
$('#myType').change();
$('#myModule').val(tModule);
$('#myModule').change();
$(this).dialog("close");
}
}
},
Cancel: function () {
$(this).dialog("close");
}
},
close: function () {
allFields.val("").removeClass("ui-state-error");
}
});
From body tag
<asp:Button ID="anyTrouble" name="anyTrouble" runat="server" Text="Report Error/Request" CssClass="annbutton" />
<div id="dialog-trouble" style="display:none;" >
<asp:Label ID="lbl_TType" runat="server" style="position:absolute; left: 40px; top: 5px; background-color:inherit; font-size:small; font-names:Cambria,small;" Visible="true" >Type of Problem/Request:</asp:Label>
<asp:DropDownList ID="ddl_TType" runat="server" ClientIDMode="Static"
style="position:absolute; left: 220px; top: 5px; background-color:inherit; font-size:small; font-names:Cambria,small; width: 265px;" visible="true">
</asp:DropDownList>
<asp:Label ID="lbl_Module" runat="server"
style="position:absolute; left: 590px; top: 5px; background-color:inherit; font-size:small; width: 114px; font-names:Cambria,small; right: 444px;"
Visible="true" >Module or Page :</asp:Label>
<asp:DropDownList ID="ddl_Module" runat="server" ClientIDMode="Static"
style="position:absolute; left: 710px; top: 5px; background-color:inherit; font-size:small; font-names:Cambria,small; width: 225px;" visible="true">
</asp:DropDownList>
<asp:TextBox ID="troubleNote" runat="server" BackColor="#F0F0F0" Visible="true" ClientIDMode="Static"
BorderColor="#669999" BorderStyle="Solid" BorderWidth="2px"
Font-Names="Cambria" Font-Size="Medium" ForeColor="Black" Rows="40"
Wrap="true" Text="" style="position:absolute; top: 25px; left: 40px; height: 600px; width: 1000px;" TextMode="MultiLine">
</asp:TextBox>
</div>