Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

onBlur event not firing script?

Posted on 2012-03-14
2
Medium Priority
?
342 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
[X]
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
2 Comments
 
LVL 15

Accepted Solution

by:
pateljitu earned 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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.
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…

636 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