I am new to jquery and I am stuck on a problem. I am trying to design a web page containing four images and i want a dialog box to popup showing the details of the current image that was clicked. However, i cannot get the text in the dialog box to change and it always shows the details of the first image.A number is set in a hidden field to identify which image was clicked, and this is then used by the GetDetail1() and GetDetail2() functions to return a string with the appropriate details.Heres the script:\[code\]<asp:HiddenField runat="server" Id="JavascriptValue" value="http://stackoverflow.com/questions/14598396/1"/><div id="dialog-block"><b>Detail1:</b><table border="0"> <tr> <td><% =GetDetail1() %></td> <td colspan="2"> <img src="http://stackoverflow.com/questions/14598396/Assets/people/silhoeutte1.jpg" width="100" height="100" style="padding-left: 100px;" /></td> </tr> <tr> <td><b>Detail2:</b></td> </tr> <tr> <td><% =GetDetail2() %></td> </tr> </table></div><script type="text/javascript">// the jQuery document ready handler$(function () { var name; // create our dialog $('#dialog-block').dialog({ title: '<%=GetImageName()%>', oneInstance: false, autoOpen: false, width: 400, buttons: { "Close": function () { closeDialog($(this)) } } });// the images to open the dialog$('#image1,#image3,#image2,#image4').click(function (event) { if (this.id == 'image1') { document.forms['form1'].JavascriptValue.value = "http://stackoverflow.com/questions/14598396/1"; //set the value $('#dialog-block').dialog('open'); } else if (this.id == 'image2') { document.forms['form1'].JavascriptValue.value = "http://stackoverflow.com/questions/14598396/2"; //set the value $('#dialog-block').dialog('open'); } else if (this.id == 'image3') { document.forms['form1'].JavascriptValue.value = "http://stackoverflow.com/questions/14598396/3";//set the value $('#dialog-block').dialog('open'); } else if (this.id == 'image4') { document.forms['form1'].JavascriptValue.value = "http://stackoverflow.com/questions/14598396/4"; //set the value $('#dialog-block').dialog('open'); }});});function closeDialog(elem) { elem.dialog("close");}</script>\[/code\]GetDetail Functions\[code\]public String GetDetails1(){ List<User> imagelist = DatabaseAccessor.getImagesFromDataBase(); return imagelist[Convert.ToInt32(JavascriptValue.Value)].Detail;}\[/code\]