• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 344
  • Last Modified:

onBlur event not firing script?

Can someone please help me to understand why this onBlur event for this input box will not fire off a javascript?  If I press the SAVE button it works.  I want to eliminate the need to press the SAVE button.
<% if not rs2.bof and not rs2.eof then %>
	<% do until rs2.eof %>
		<form action="SplitTransSave.asp?proxyfor=<%= sUserName %>&mode=<%= sMode %>&TID=<%= rs2("TID") %>&amp;Orig=<%= Request.QueryString("TID") %>" method="POST" name="frm<%= rs2("TID") %>">
		<tr>
			<td align="left" bgcolor="<%= sBGColor %>" width="1%" nowrap><font face="verdana,tahoma,arial" size="1" color="#000000"><%= rs2("TID") %></font></td>
			<td align="left" bgcolor="<%= sBGColor %>" width="1%" nowrap><font face="verdana,tahoma,arial" size="1" color="#000000"><%= rs2("CHolderName") & ", " & rs("CHolderFName") %></font></td>
			<td align="left" bgcolor="<%= sBGColor %>" width="1%" nowrap><font face="verdana,tahoma,arial" size="1" color="#000000"><%= rs2("StmtDate") %></font></td>
			<td align="left" bgcolor="<%= sBGColor %>" width="1%" nowrap><font face="verdana,tahoma,arial" size="1" color="#000000"><%= rs2("TranDate") %></font></td>
			<td align="left" bgcolor="<%= sBGColor %>" width="1%" nowrap><font face="verdana,tahoma,arial" size="1" color="#000000"><%= rs2("PostDate") %></font></td>
			<td align="left" bgcolor="<%= sBGColor %>" width="1%" nowrap><font face="verdana,tahoma,arial" size="1" color="#000000"><%= rs2("Merchant") %></font></td>
			<td align="left" bgcolor="<%= sBGColor %>" width="1%" nowrap><font face="verdana,tahoma,arial" size="1" color="#000000">$</font><input type="text" name="txtTranAmt" value="<%= FormatNumber(rs2("TranAmt"),2) %>" onblur="javascript:bSave=1;" size="8" style="font-family: Tahoma; font-size: 7pt" /></td>
			<td align="left" bgcolor="<%= sBGColor %>" width="93%"><a href="javascript:doSave(<%= rs2("TID") %>);" onClick="javascript:bSave=1;"><img src="images/save.gif" border="0" alt="Save this transaction..." WIDTH="18" HEIGHT="18"></a></td>
		</tr>
		</form>
		<% rs2.movenext %>
		<% if sBGColor = "white" then %>
			<% sBGColor = "lightgrey" %>
		<% else %>
			<% sBGColor = "white" %>
		<% end if %>
	<% loop %>
<% end if %>

Open in new window

<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--

var bSave = 0

function window_onload() 
{
document.frmChange.txtChange.value='0';
}

function window_onbeforeunload() 
{
	if(bSave==0)
	{
		document.location.href="SplitTransDel.asp?proxyfor=<%= sUserName %>&mode=<%= sMode %>&TID=<%= Request.QueryString("TID") %>";
	}
}

function window_onunload() 
{
	if(bSave==0)
	{
		document.location.href="SplitTransDel.asp?proxyfor=<%= sUserName %>&mode=<%= sMode %>&TID=<%= Request.QueryString("TID") %>";
	}
}

function doSave(nTID)
{
	eval('document.frm'+nTID+".submit();");
}

function doDone(nTID)
{
	document.location.href="SplitTransDone.asp?proxyfor=<%= sUserName %>&mode=<%= sMode %>&TID=<%= Request.QueryString("TID") %>";
}


//-->
</script>

Open in new window

0
Ahelbling
Asked:
Ahelbling
1 Solution
 
pateljituCommented:
You would need to call doSave function along with assign variable bSave with value 1, please try this line change:

<input type="text" name="txtTranAmt" value="<%= FormatNumber(rs2("TranAmt"),2) %>" onblur="javascript:bSave=1;doSave(<%= rs2("TID") %>);" size="8" style="font-family: Tahoma; font-size: 7pt" />
0
 
AhelblingAuthor Commented:
Excellent.  Thank you!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now