Can anyone point me to an example of exchanging data back and forth from PHP to javascript using list boxes?

teryhill wrote on Thursday, March 19, 2015:

Here’s what I have done. I have changed zip code to a list box with add. and I have that part working it will update the city and the state with the information based on the zip code. The state list with add is still there and functional I update the city/state information by updating the form with the information from within options_listadd.inc.

Ok here is where I am stuck for the moment. When I just select the zip code from the list box how do I update the city/state information on the form. I am trying to shoehorn this in to the demographics_full.php.

The whole Idea to this is to cut down on address mistakes , so city,state and zip are entered in via the zip code. We can get the zips from the postal service or you can add the common ones for the service area via the list box with add function.

Thanks
Terry

fsgl wrote on Thursday, March 19, 2015:

Auto-complete exists for Demographics.

Can you leverage this feature?

Patients’ city & zip codes are, for the most part, local; while the state is, 90% of the time, the same as for the practice.

teryhill wrote on Thursday, March 19, 2015:

I will look at that. I kinda envision this working for any screen where zip information is, so most insurance companies are out of state. I have the info going to the form I just need to get the selected zip from the form.

fsgl wrote on Friday, March 20, 2015:

Insurers & pharmacies are one-time deals.

Both are entered in Practice once. Staff then pulls from drop-down menu.

fsgl wrote on Friday, March 20, 2015:

One more thing that you may find useful. Setting defaults.

We’ve set our state, Race, Ethnicity, Language as defaults in Lists (third or fourth column).

The last 3 needed for MU. No point using drop-down when 99% of the population from the same tribe.

teryhill wrote on Saturday, March 21, 2015:

I have looked at code until my brain is mush. I know that I need to do an ajax call to get the data I am wanting. I just cannot grasp what I need to do. I am working in the demographics_full program and I am trying to get the data contained in f.form_postal_code.value read it in to a php section to look up data in the list options table.

Any direct help would be greatly appreciated.

Thanks
Terry

teryhill wrote on Saturday, March 21, 2015:

By the way

Thanks fsgl for all your help. You do help keep me thinking.

Terry