How to change a label's text after loading a html into a dialog
- by Salsa
I am opening a modal dialog by loading a form into it. After loading the form, I want to change it's title and one of it's fields' label. I can change the label's text, but after the function returns, the label's text turns back to it's original one. Is it possible to make this kind of change and if so, how?
The HTML:
<form action="testing.php" method="POST" id="example-form">
<fieldset>
<label for="link" id="link-label"></label>
</fieldset>
</form>
The javascript:
$(".bt-example").button().click(function() {
$('#example-dialog').load('form.html').dialog('open');
$('.ui-dialog-titlebar').text("THIS WORKS!");
$('#example-form #link-label').text("CHANGES AT FIRST, BUT GOES BLANK LATER");
$('#example-dialog').removeClass('invisible');
});