We are using jQuery 1.3.2 and jQuery UI 1.7.2 in our project.
Everything was working perfect till we were using jQuery UI 1.7.1. Then we upgraded to jQuery UI 1.7.2, but it is causing a trouble in Opera (9.63).
The issue is as follows :-
There is a jQuery UI dialog with a textarea and a submit button which posts the data in "textarea" to the server. Before opening the dialog the value of textarea is set to blank.
Also I am using Modal:true to get the overlay.
Now when I open the dialog for the 1st time, enter some data in textarea and click submit, it posts the data to server.Then I close the dialog, and reopen it, again enter some text in the text area and submit again. This time it is posting empty data (or whatever value was set for the "textarea" before openeing the dialog.)
The issue is only in Opera and rest browsers are working fine. Even opera works fine if i set modal as false, or if i use jQuery UI 1.7.1.
Here is a sample program.
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.2");
//Attach a hidden dialog to body.
function initDialog()
{
var innerDiv = $("`<div>`");
$(innerDiv).attr({'id' : 'testDialog'});
var textBox = $("`<textarea>`");
$(textBox).attr({'id' : 'testBox', 'rows' : '2'});
$(innerDiv).append(textBox).appendTo('body');
$('#testDialog').css('visibility', 'hidden');
$('#testDialog').dialog({
autoOpen : false,
width : 500,
modal : true,
title : 'Enter text and click Alert',
buttons :
{
"Alert" : function() {
alert($('#testBox').val());
}
}
});
}
//Show the hidden dialog.
function showDialog()
{
$('#testDialog').css('visibility', 'visible');
$('#testBox').val('');
$('#testDialog').dialog('open');
}
window.onload = function() {
initDialog();
$('#mylink').click(function(){
showDialog();
});
}
</script>
<body>
<a href="javascript:void(0);" id='mylink'>Click here </a>
</body>
If we use google.load("jquery", "1.7.1") it will work perfect.
Or if i set modal:false then also it will work fine.