Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 17th, 2005, 11:14 PM
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.......


but i do test this code in html page, it seem working well.i try it by run the .aspx page then right click and view code then save as the code as .html it seem working.cause aspx page will render as plain html as run at the server then i test over this code should get the same result right?
 
Old May 23rd, 2005, 12:33 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to parithi
Default

1 first you know one thing,html control and server control is different,using server control to specfic runat="server" inside of tag.
2.inside script block to access the server control using two ways
  a.document.(form name).elements.txtcount.value
  b. document.all.item("control name").value
     example
using script side
function recalStkBal()
{
    document.all.item("txtStkBal").value=parseFloat(do cument.all.item("txtOpenbal").value)-parseFloat(document.all.item("txtStkDed").value);}
with in code behid using this code
private void Page_Load(object sender, System.EventArgs e)
        {

            txtOpenBal.Attributes.Add("onblur","recalStkBal()" )

        }

 
Old May 23rd, 2005, 12:43 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to parithi
Default

//*This coding developed C.Elamaprithi M.C.A..*\//Mail;parithi_kum@yahoo.co.in,parithi4u@hotmail.com \--------------------------------------------------------
1 first you know one thing,html control and server control is different,using server control to specfic runat="server" inside of tag.
2.inside script block to access the server control using two ways
  a.document.(form name).elements.txtcount.value
  b. document.all.item("control name").value
     example
using script side
function recalStkBal()
{
    document.all.item("txtStkBal").value=parseFloat(do cument.all.item("txtOpenbal").value)-parseFloat(document.all.item("txtStkDed").value);}
with in code behid using this code
private void Page_Load(object sender, System.EventArgs e)
        {

            txtOpenBal.Attributes.Add("onblur","recalStkBal()" )

        }






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
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.