View Single Post
  #1 (permalink)  
Old April 21st, 2004, 04:31 AM
rok rok is offline
Registered User
 
Join Date: Apr 2004
Location: New Delhi, Delhi, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rok
Default not able to save data using javascript

hi,

i created an asp page that stores and retrieve data from sql database. the thing is that there is a floating menu(created using javascript) in the page that performs the functions such as edit, save etc....the prblm is tht i am not able to save the data using the floating menu(even document.form1.submit didnt work) but is able to save it using the menus available on the page..pls help..:(..the floating menu code is as below:-
<script language=javascript>

if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>

<layer id="divStayTopLeft">

<table border="1" width="130" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="black">
<p align="center"><b>Menu</b></td>
</tr>
<tr>
<td width="100%" bgcolor="beige">
<p align="center">
<a href="#" onclick="javascript:return add_onclick();"><b>Add</b></a><br>
<a href="javascript:document.form1.submit();" onclick="javascript:savelk();"><b>Save</b></a><br>
<a href="#" onclick="javascript:edit_onclick();"><b>Edit</b></a><br>
<a href="javascript:document.location.replace('../academicmodule/masters.asp')"><b>Close</b></a><br>
<a href="#" onclick="javascript:saveall_onclick();"><b>Save All Classes</b></a></td>

</
</table>

</layer>


<script type="text/javascript">

var verticalpos="frombottom"

if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
var startX = 650,
startY = 400;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var

el=d.getElementById?d.getElementById(id):d.all?d.a ll[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.t op=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop +

document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop +

document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>




rgds,
rok