Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:18 PM
George
Guest
 
Posts: n/a
Default Field calcs with OnBlur

I am trying to have an auto calculation happen on a form when 1 of 2 boxes get data keyed into them. I tried using ONBLUR with both textboxes, but I kept getting an invalid object. I use VBscript for my coding.


<%
response.write(<td class=""detaill""><input type=""text"" name=""txtRate_1"" size=""5"" onBlur=""CalcTotal"" ></td>")


sub CalcTotal
..
..
..
end sub


%>

Any help would be appreciated.

Thanks,

George
  #2  
Old July 19th, 2005, 02:18 PM
Rob Collyer
Guest
 
Posts: n/a
Default Re: Field calcs with OnBlur

=?Utf-8?B?R2Vvcmdl?= <George@discussions.microsoft.com> wrote in
news:234B33BC-B093-42B0-9226-86D6AD656E06@microsoft.com:
[color=blue]
> I am trying to have an auto calculation happen on a form when 1 of 2
> boxes get data keyed into them. I tried using ONBLUR with both
> textboxes, but I kept getting an invalid object. I use VBscript for
> my coding.
>
>
> <%
> response.write(<td class=""detaill""><input type=""text""
> name=""txtRate_1"" size=""5"" onBlur=""CalcTotal"" ></td>")
>
>
> sub CalcTotal
> .
> .
> .
> end sub
>
>
> %>
>
> Any help would be appreciated.
>
> Thanks,
>
> George
>[/color]

THe VBScript need to be CLIENT side.... it looks like the CalcTotal
function you are referring to resides in server side script.

--
Robert Collyer
www.webforumz.com
Free Web Design and Development Help, Discussions, tips and Critique!
ASP, VB, .NET, SQL, CSS, HTML, Javascript, Flash, XML, SEO !
  #3  
Old July 19th, 2005, 02:18 PM
Aaron [SQL Server MVP]
Guest
 
Posts: n/a
Default Re: Field calcs with OnBlur

You will need to have CalcTotal in client-side script. ASP runs *once*,
returns HTML/client-side script to the client, and then doesn't exist. So
your client-side action can't magically call your server-side CalcTotal,
because it no longer exists. View the source, do you see it? Anything that
the client can do must be visible to the browser. ASP code is not visible
to the browser, it runs on the server and goes out of scope before the
browser displays a result that the end user can interact with.

--
http://www.aspfaq.com/
(Reverse address to reply.)




"George" <George@discussions.microsoft.com> wrote in message
news:234B33BC-B093-42B0-9226-86D6AD656E06@microsoft.com...[color=blue]
> I am trying to have an auto calculation happen on a form when 1 of 2 boxes[/color]
get data keyed into them. I tried using ONBLUR with both textboxes, but I
kept getting an invalid object. I use VBscript for my coding.[color=blue]
>
>
> <%
> response.write(<td class=""detaill""><input type=""text""[/color]
name=""txtRate_1"" size=""5"" onBlur=""CalcTotal"" ></td>")[color=blue]
>
>
> sub CalcTotal
> .
> .
> .
> end sub
>
>
> %>
>
> Any help would be appreciated.
>
> Thanks,
>
> George[/color]


 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles