This topic is locked

field in add page that triggers event to look up values for some other

9/8/2010 6:35:02 PM
ASPRunnerPro General questions
T
tone21705 author

Hi,
First off, thanks for your help and amazing support!
I am making an ASPRunner project and I am having a little trouble figuring out how to do this.
On the add page the first field is Medical Record Number (MRN)
After the user types in the MRN (all 8 characters) I want it to query a table and return a few values (pt name, gender, age, race, etc) and value them in the proper fields.
Sometimes things are outdated or incorrect so I want the user to be able to change them.
For example:
User enters 00000000
and the fields are automatically populated with the data.
Patient Name: Joe Blow

Address: 1234 Main St.

Gender: M
Im assuming there is a combination of JavaScript events and code snippets. If you could just point me in the right path, that would be amazing.
Thanks so much,

Antoni

A
ann 9/9/2010

Antoni,
there are only two ways to set up such page.

First is to set up fields (pt name, gender, age, race, etc) as dependent dropdowns on the Edit as settings dialog (Lookup wizard tab).

Check Edit box with Ajax popup and Allow to add new values on the fly options on the tab.

Or you need to create a button on the page which will fill fields directly on the page.

T
tone21705 author 9/10/2010

If I am interested in the button that fills the fields how would I go about doing that?
Thanks,

Antoni



Antoni,
there are only two ways to set up such page.

First is to set up fields (pt name, gender, age, race, etc) as dependent dropdowns on the Edit as settings dialog (Lookup wizard tab).

Check Edit box with Ajax popup and Allow to add new values on the fly options on the tab.

Or you need to create a button on the page which will fill fields directly on the page.

A
ann 9/15/2010

Antoni,
use Insert button feature on the Visual Editor tab.

To return the value of the field use the following code (Client Before tab):

params["txt"] = document.forms.editform1.value_MRN_1.value;



Use params("txt") variable in your Server code:

str = "SELECT * FROM Table WHERE MRN=" & params("txt");

set rstmp = CustomQuery(str);

result("txt") = rstmp("gender");

rstmp.close

set rstmp=nothing



Then return correct value and assign it in the Clent after event:

document.forms.editform1.value_gender_1.value = result["txt"];
R
rod 9/15/2010



Antoni,
use Insert button feature on the Visual Editor tab.

To return the value of the field use the following code (Client Before tab):

params["txt"] = document.forms.editform1.value_MRN_1.value;



Use params("txt") variable in your Server code:

str = "SELECT * FROM Table WHERE MRN=" & params("txt");

set rstmp = CustomQuery(str);

result("txt") = rstmp("gender");

rstmp.close

set rstmp=nothing



Then return correct value and assign it in the Clent after event:

document.forms.editform1.value_gender_1.value = result["txt"];



Ann,
Just following along here... What would be the button properties when using PHPRunner?
Tnx, Rod

R
rod 9/16/2010



Rod,
here is a sample for PHP:

http://www.asprunner.com/forums/topic/14923-insert-button-feature-to-update-field-during-add-page/pagehlparams[fromsearch1


Ann,
I made the patch to the buttonhandler.php for "add-pages" and will try the button code again when I get some time.
Many Thanks.