Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 17th, 2005, 11:14 PM
Registered User
 
Join Date: May 2005
Location: Georgetown, Penang, Malaysia.
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?
Reply With Quote
  #2 (permalink)  
Old May 23rd, 2005, 12:33 AM
Registered User
 
Join Date: May 2005
Location: Chennai, Tamil Nadu, India.
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()" )

        }

Reply With Quote
  #3 (permalink)  
Old May 23rd, 2005, 12:43 AM
Registered User
 
Join Date: May 2005
Location: Chennai, Tamil Nadu, India.
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()" )

        }

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:54 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.