Click to See Complete Forum and Search --> : how to stop calling JS method ?
adusumalli
May 13th, 2009, 01:08 PM
Hi
I have a onclick link to calling one Javascript method. after calling that JavaScript method the another Javascript method is also calling by default. so how do i stop the another JavaScript method .
The folling code i wrote
function newApptCloseWithoutSave() // this method i need to call
{
document.getElementById('fcNewApptName').style.display = "none";
}
function newApptNameInline( day, start,cell ) // this method is calling unnecessarily
{
if ( fcCalRefreshInProgress == 1 )
return;
// un-hide it
obj.style.visibility = 'visible';
obj.style.display = "block";
// put it above any other divs (hopefully)
obj.style.zIndex = 99999;
$('fcNewApptNameInput').value = '';
$('fcNewApptNameInput').focus();
$('fcNewApptNameInput').select();
}
thanks in advance..
PeejAvery
May 13th, 2009, 03:15 PM
There is nothing in the code you posted which would cause the second function to fire.
Either you have it also in the onclick event, or another section of JavaScript is attaching that to its onclick event.
adusumalli
May 13th, 2009, 03:31 PM
from this code , first JavaScript method is calling . and i am clicking the 'close' link in this code.
<div id="fcNewApptName" onclick=""
style="visibility: hidden; overflow: none; position: absolute; border: 1px solid black; background-color: white;">
<table border="0" cellspacing="0" style="padding: 0px;">
<tbody>
<tr>
<td>
<table border="0" cellspacing="0" style="padding: 0px;">
<tbody>
<tr>
<td style="padding: 0px;">
<input type=text size=32 id=fcNewApptNameInput name=fcNewApptNameInput class=verySmall
style="border: 1px solid; padding: 0px; " value=""
onkeypress="handleKeyPressExecFunc(event, newApptSaveAndClose,null)"
onclick="disableNewApptOnClick=true;">
</td style="padding: 0px;">
<td class="verySmall" align="right" bgcolor="#ddddee" style="padding: 0px;">
<img src="graphics/ozIcon13Close.gif"
onclick="newApptCloseWithoutSaving()">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<a href="#" style="margin-top: 0px; margin-left: 2px;" class=verySmallGrey2NL
onclick="newApptSaveAndEdit()">Edit
<img src="graphics/arrow_btn.gif" align=absmiddle border=0> </a>
<a href="#" class=verySmallGrey2NL
onclick="newApptSaveAndForceClose()">Save and Close
<img src="graphics/arrow_btn.gif" align=absmiddle border=0></a>
<a href="#" class=verySmallGrey2NL onclick="newApptCloseWithoutSave()">Close</a> // Here calling 1st JS Method. I am clicking on this link .
</td>
</tr>
<tr>
<td class=verySmallGrey2NL onclick="disableNewApptOnClick=true;">
<input id="fcQuickAddRemember"
type="checkbox" <%= quickAddApptRemember ? "checked" : "" %>
onclick="updateQuickAddRemember();">Always Open Edit Page
</td>
</tr>
</tbody>
</table>
</div>
From here the second JS method is calling.
<TR valign=top>
<TD width=1 height=20 bgcolor=<%=cellbgcolor%>><img src="graphics/z0.gif" id="markV_<%=hour*2+1%>" width=1 height=20 align=abstop></td>
<TD width=5% class=verySmall bgcolor=<%=cellbgcolor%> align=left><span class=verySmallGreyLight> </span></TD>
<TD class=verySmall bgcolor=<%=cellbgcolor%> width=<%=bsx%> align=left valign=top id="CELL_NO_0_<%=hour*2+1%>"
onclick="newApptNameInline( '<%=ozDay.renderDayKey(_ahsPage)%>', '<%=BaseCalTime.formatHour( hour, 30 )%>',this);" scope="col">
<img src="graphics/z0.gif" width=1 height=1 align=top id="loc_0_<%=hour*2+1%>" >
</TD>
</TR>
adusumalli
May 13th, 2009, 04:05 PM
Actually It is working properly in IE. But not in Mozilla.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.