views:

246

answers:

2

I am populating a textbox (txtFileNature) with a value from a popup window. The textbox has an onfocus handler set to

onfocus=("this.blur();")

The problem is that I want to do some calculations based on the value of txtFileNature and want to display the result below it. In which event can I can use my VB code. I can't use the textchanged event since I am not typing in the textbox.

A: 

Depending on the nature of the calculation, you can either do this on the server side or the client side. If the nature of the calculation allows it to be done on the client, you should do your calculation using the onchange client-side event, as fusion wrote in his answer.

If it's a server-side calculation you need, then you have a number of options. I'm assuming you have some client-side event that populates the txtFileNature textbox on the client. You can add to that event to have it trigger an AJAX call or a postback (depending on your application) to get the result of the calculation. Alternatively you can use the onchange client-side event to trigger a postback or AJAX call. Either way, the end result is the same.

Welbog
i am using serverside calculation in which i am calling storeprocedure, how can i call this serverside function from javascript. can u show one eg plz..
vidhya
I can't give you a useful example without more details from you.
Welbog