This topic is locked

Change field after entry

7/30/2007 4:07:43 PM
ASPRunnerPro General questions
J
jsherknus author

Hello,
I have an "Add" screen that has two fields...SKU and price. After the SKU is entered, I would like to run some code (actually a call to a webservice to get the price which is in XML format---I have the code) to lookup the price based on the SKU and populate the price field. How can I do this with custom code? I see where I can do it before update, but I would rather do it after I enter the SKU in the Add screen.

Sergey Kornilov admin 7/31/2007

You need to modify generated page manually to add an AJAX call to your web service when SKU field loses focus.

This routine should retrieve the price and update corresponding field on the web page.

J
jsherknus author 7/31/2007

You need to modify generated page manually to add an AJAX call to your web service when SKU field loses focus.

This routine should retrieve the price and update corresponding field on the web page.


Thanks! Sounds good. Where would I do this? I see a file that gets created called product_add.asp and in there is a section called
'// processing sku - start
is that where I make the change?

Sergey Kornilov admin 8/2/2007

This change needs to be made in the Add page template.
Replace

{build_edit_control field="SKU" value=$value_SKU mode="add"}

with

<input type=text name="value_SKU" value="" onBlur="Your AJAX function call goes here">