PDA

View Full Version : DHTML Window - Cannot change content in div dhtmlwindow.



skpshah
02-27-2014, 02:43 AM
I have a form... On clicking add I want to load a div dhtml window to get confirmation. This div has submit and modify button. On clicking Modify the user is again back to main form to make changes and again clicks add. Now again the div dhtml window shows up but the changed content does not show. It shows old content. I want the content to change. Please help



Here is my code with simple form



<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="/js/jquery/jquery.tools.min.js"></script>
<!-- dateinput styling -->
<link rel="stylesheet" href="windowfiles/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="windowfiles/dhtmlwindow.js"></script>


<script>
function val(theform)
{

strg = "<form name='addjob1' id='addjob' ><div id='job_details' '>Are you sure the details you entered are correct:<br\>";
strg = strg + "First Name: " + theform.fname.value +"<br\>";
strg=strg + "</div><p align='center'> <input type='button' value='Submit' onclick='sform(this.form)' />&nbsp;<input type='button' value='Modify' onclick='closeme()' /></p></form>";

document.getElementById("verify_job").innerHTML=strg;



if (typeof divwin!="undefined" && divwin.isClosed!=true){

divwin.load("div", "verify_job", "Edit Job Details");

divwin.show();
}
else
{
divwin=dhtmlwindow.open('divbox', 'div',"verify_job", "Edit Job Details", 'width=450px,height=500px,left=200px,top=150px,resize=0,scrolling=0');
}
}



function closeme()
{

divwin.hide();

}
</script>


<body>

<form action="addjob1.php" method="post" name="addjob" id="addjob" >
<tr><td class="compl">First Name</td><td><input type="text" name="fname" /></td></tr>
<input type="button" name="ssform" value="Add" onClick="javascript:val(this.form);"/></center>
</form>


<div id="verify_job" style="display:none;">




</div>
</body>