I am using dialog api of jquery. Like this:
<tr>
<td> </td>
<td colspan="3">
<a href='#' id='btnAddNewSkill'> add new</a>
</td>
<td>
<div id="addNewSkillDialog" style='visibility: hidden;'>
<form>
<table width='100%' border='0'>
<tr>
<td>
<label for="name">Name of New Skill</label>
<input type="text" name="name" id="name" class=" ui-corner-all" />
</td>
</tr>
</table>
</form>
</div>
</td></tr>
But here the problem is the form is visible by default and after first click to button it shows in a dialog thing, and after that it works correct (i.e. the dialog part)....so to overcome that thing I kept the visibility (of the Main div) as hidden in start and changing it on the fly as:
$('#btnAddNewSkill').click(function() {
$("#addNewSkillDialog").css('visibility', 'visible').dialog({
show : "fold",
hide : "explode",
resizable : false,
modal : true,
closeOnEscape : true,
height : 120,
title : 'Add New Skill',
buttons : {
"Add Skill" : function() {
alert('Add skill Clicked');
},
Cancel : function() {
$(this).dialog("close");
}
},
close : function() {
$(this).dialog("dispose");
}
});
});
This is not the correct procedure to do this..... how should I make a form as a dialog from the start itself