Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

onBlur event not firing script?

Posted on 2012-03-14
2
328 Views
Last Modified: 2012-03-14
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
Comment
Question by:Ahelbling
2 Comments
 
LVL 15

Accepted Solution

by:
pateljitu earned 500 total points
ID: 37722068
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
 

Author Closing Comment

by:Ahelbling
ID: 37722088
Excellent.  Thank you!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question