I got a button name "modify" and when clicked got the value of it by the following
$('button[name=modify]').click(function() {
alert("button value that you click "+$(this).val());
mybuttonvalue=$(this).val();
alert("mybuttonvalue @ button click "+mybuttonvalue);
$( "#mydialog" ).dialog( "open" );
})
and the variable called "mybuttonvalue" is declared after document is ready and used at the model dialog form' open method as follow
open:function(){
alert(mybuttonvalue);
alert($('#ztitle'+mybuttonvalue).val());
alert($('#znews'+mybuttonvalue).val());
$('#title').val($('#ztitle'+mybuttonvalue).val());
$('#news').val($('#znews'+mybuttonvalue).val());
},
at this point the value of the variable is always 0. can someone point me out where did i make wrong. plz? thanks