Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2005, 02:51 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with client side script

i am now doing the asp.net with javascript as client side script.
i have a script as below
<script language="javascript">
function recalStkBal(){
txtStkBal.value=parseFloat(txtOpenbal.value)-parseFloat(txtStkDed.value)
}
</script>

 and with the web control

<asp:textbox name="txtOpenBal">....
<asp:textbox name="txtStkDed">....
<asp:textbox name="txtStkBal">....

 and with code behind

private sub page_load(....)..
txtOpenBal.attribute.add("onBlur","recalStkBal()")

so what i expect is when the user lost focus from the txtOpenBal the "recalStkBal()" should raise and reset the txtStkBal.value to the new value.but i cannot get it so can or any one can help me up? thanks in advance.......
 
Old June 8th, 2005, 08:53 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

You can't set server controls value in javascript like this
txtStkBal.value=parseFloat(txtOpenbal.value)-parseFloat(txtStkDed.value)

You should do like this...
document.forms[0]['txtStkBal'].value=parseFloat(txtOpenbal.value)-parseFloat(txtStkDed.value)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Client Side Script not working in DNN rpdrake BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6 2 February 27th, 2009 03:06 PM
Client Side Script Not Working sramesh ASP.NET 2.0 Basics 3 August 2nd, 2007 03:56 PM
Client-side script debugging problem on WindowsXP Dmitriy ASP.NET 1.0 and 1.1 Professional 1 October 12th, 2005 09:24 AM
Problem with client side script cschng Classic ASP Basics 2 May 23rd, 2005 12:43 AM
please help ping with client side script nlicata VBScript 0 June 10th, 2004 01:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.