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

Re: Field calcs with OnBlur by Rob

Rob
Tue Jul 20 08:12:40 CDT 2004

=?Utf-8?B?R2Vvcmdl?= <George@discussions.microsoft.com> wrote in
news:234B33BC-B093-42B0-9226-86D6AD656E06@microsoft.com:

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

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 !

Re: Field calcs with OnBlur by Aaron

Aaron
Tue Jul 20 08:12:38 CDT 2004

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