Drop-Down

Discuss everything related to Medical Appointment. All versions. Any questions related to the Medical Appointment developing or using should be posted to this forum.

Moderators: alexandrleonenko, Milton

Rascal@1
Newbie
Newbie
Posts: 7
Joined: Dec 29th, '16, 21:51

Drop-Down

Postby Rascal@1 » Jan 24th, '17, 18:59

Good Day

I need to know, how do I convert a Static field in to a Dropdown?

I want to pre-Populate it with data

Please Assist
Attachments
dropdown.png
dropdown.png (6.14 KiB) Viewed 1472 times

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: Drop-Down

Postby ne_moj » Jan 25th, '17, 10:56

Hello

Please tell us which pages you want to add it.

Rascal@1
Newbie
Newbie
Posts: 7
Joined: Dec 29th, '16, 21:51

Re: Drop-Down

Postby Rascal@1 » Jan 25th, '17, 18:02

Hi There

It will need to affect all the pages..

But the Primary would be Patient Registration, followed by Doctors.

The idea is to swap the fields around, so that the Patient can input the zip code First, then basesed on the zip it will populate the city, then the state/province

But on the viewing page it will need to be in order, as it currently is.

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: Drop-Down

Postby ne_moj » Jan 27th, '17, 11:02

Hello

If I understand correctly, when filling zip_code you want to select the city and state/province. It is not necessary to do a drop-down list of towns. You need to make the ajax-request when removing focus from the field zip_code, which will do a search of the city and state/province.

If I understand you correctly, I will describe what must be done.

Rascal@1
Newbie
Newbie
Posts: 7
Joined: Dec 29th, '16, 21:51

Re: Drop-Down

Postby Rascal@1 » Jan 27th, '17, 13:33

Hi There

That is correct.

Thank you

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: Drop-Down

Postby ne_moj » Jan 30th, '17, 12:25

Hello

For example, I want to correct the edit and the add pages of patients.
1) For this, I need to edit the file Patients.class.php (include/classes directory). In __construct() method finds the fields "Zip Code" (variables $this->arrAddModeFields and $this->arrEditModeFields) and to set the parameters of the field b_zipcode javascript_event (in this parameter specifies the event and the function that will be called when the event is triggered, for example - 'javascript_event'=>'onblur="yourFunction(this.value)")
2) js/main.js file add function yourFunction() that will do all the work. Do the ajax-request to the server and replacing html. For example, you can see function appChangeCountry() in the same file.
3) You must create a script that will take the ajax-request from your function yourFunction(), and send it in response to json or xml format. All files that work with ajax are in directory ajax/


Return to “ApPHP Medical Appointment / uDoctorAppointment Talk {developers/users}”