I am trying to pop-up a window to enter value to use the value on postback.
I searched a lot on internet and able to build the pop-up codes for the server control, below is my code.
But after building this much i am not able to fire button click event(do postback) from dialog "Charge" button and how to use the value entered.
I tried to use
document.getElementById("<%=Open.ClientID %>").click();
from "Charge" with no use as well as used $(e.currentTarget).unbind('click');
e.currentTarget.click();
. But non worked.
$(document).ready(function() {
$('#Open').click(function(e){
e.preventDefault();
$( "#Open-dialog" ).dialog( "open" );
});
$( "#Open-dialog" ).dialog({
modal: true,
autoOpen: false,
height: 255,
width: 300,
buttons: {
"Charge": function() {
var amount = $('#Amount').val();
$( this ).dialog( "close" );
return true;
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
});
});
<form id="form1" runat="server">
<asp:Button id="Open" Text="Charge" runat="server" OnClick="Open_Click"/>
<asp:Label ID="txt" Text="hi" runat="server" Visible="false"></asp:Label>
<div id="Open-dialog" style="display: none;" title="Enter Amount">
<label for="Amount">Amount</label>
<input type="text" name="Amount" id="Amount" class="text ui-widget-content ui-corner-all" value="$" />
</div>
</form>
I am not able to find any clear picture of doing this in any of the questions,could anyone please help me out and give a hint on how to proceed..
Thanks in advance..