B
baldrick
Hi,
I have a div on my page as below and want to write the content of the
div to a cookie so information can be passed between two differnet
pages. With the runat=server I find that the div is not visible to the
rest of page as I get the cant 'find div message'.
The application works fine without the runat=server, but I need to be
able to store the contents of the div in a databse for later recall,
hence need the runat=server.
I also need the div to be accessible by the second page as it directly
reads the content using javascript...
parent.document.getElementById("coordinates").innerHTML = html ;
Does anyone have any simple solution or workaround as to how I can
keep the div accessible to javascript but also be able to keep the
runat=server bit?
Regards,
Phil
Code snippets....
<div id="coordinates" runat=server></div>
Me.MasterPageForm.Attributes.Add("onsubmit", "javascript: return
Polygon_Client();")
<script language="javascript" type="text/javascript">
// this writes coordinates to a cookie
function Polygon_Client(){
var element = document.getElementById("coordinates");
if (element) {
document.cookie = "coordinates=" +
document.getElementById("coordinates").innerHTML;
}
else
{
alert('javascript cant find div coordinates');
}
return true;
}
</script>
I have a div on my page as below and want to write the content of the
div to a cookie so information can be passed between two differnet
pages. With the runat=server I find that the div is not visible to the
rest of page as I get the cant 'find div message'.
The application works fine without the runat=server, but I need to be
able to store the contents of the div in a databse for later recall,
hence need the runat=server.
I also need the div to be accessible by the second page as it directly
reads the content using javascript...
parent.document.getElementById("coordinates").innerHTML = html ;
Does anyone have any simple solution or workaround as to how I can
keep the div accessible to javascript but also be able to keep the
runat=server bit?
Regards,
Phil
Code snippets....
<div id="coordinates" runat=server></div>
Me.MasterPageForm.Attributes.Add("onsubmit", "javascript: return
Polygon_Client();")
<script language="javascript" type="text/javascript">
// this writes coordinates to a cookie
function Polygon_Client(){
var element = document.getElementById("coordinates");
if (element) {
document.cookie = "coordinates=" +
document.getElementById("coordinates").innerHTML;
}
else
{
alert('javascript cant find div coordinates');
}
return true;
}
</script>