• Resolved bob1500

    (@bob1500)


    I would like to use 2 fields from my database, house_number and street_name to insert into JavaScript code that creates a URL to search a county property records website. Our HOA is using a Participants Database to store homeowners’ property and contact information. We need to access the county property records to obtain the current mailing address for properties. This may differ from the homeowner’s street address. I live in a resort area and many people here have second homes, with their primary home being elsewhere. My idea is that after a search, at the end of the pdb_single page I could place the JavaScript code that would use the returned house_number and street_name and, upon pressing a button, launch the URL to search for the corresponding record in the county property records where the homeowner’s mailing address is stored. Can anyone help with this idea?

    Thanks,
    Bob

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter bob1500

    (@bob1500)

    Here is a screenshot of what I am trying to do. House Number and Street Name are displayed from a Participants Database record search. I want to have these fields copied to the corresponding search fields below which will then find the property record in the Larimer County property records website. I can manually enter the House Number and Street Name in the JavaScript search fields, but would rather have it be done automatically.

    Plugin Author xnau webdesign

    (@xnau)

    Generally, this is too complicated a request to be answered in a support forum. You’ll need to get the help of a WordPress developer to implement something like this.

    Strictly speaking, you won’t need javascript for this, the info request can be handled in the backend much more efficiently, plus the result can be stored so the request doesn’t have to happen every time a record is displayed.

    Thread Starter bob1500

    (@bob1500)

    Regarding your comment, “Strictly speaking, you won’t need javascript for this, the info request can be handled in the backend much more efficiently, plus the result can be stored so the request doesn’t have to happen every time a record is displayed.”
    Can you give me a hint of where to go to find out how to do this? Creating an html field is one idea I have had, if I can insert fields from the PD database record (i.e. house_number and street_name) into the resulting html statement.

    Plugin Author xnau webdesign

    (@xnau)

    An operation like you’re asking about can be pretty tricky to implement because you need to get information from another server. This can often take some time, so the request needs to be made asynchronously so that it doesn’t hold things up while the php script is waiting for the response. Since this is fairly technical, I suggest you find a WordPress developer to help you.

    If you’re interested to see the function that you would use to get the remote information, take a look at the WP_Http class methods.

    As to adding the value to the record, you would probably use a regular text field to receive the data from the remote server. This is typically done when the record is created or updated using a hook like pdb-after_submit_add or pdb-after_submit_update. The code is executed on the hook, then when the response comes back from the server, the record is updated with the content of that response. It’s best not to try to get the external data when the record is displayed, this could result in a slow page load.

    Thread Starter bob1500

    (@bob1500)

    Thank you for the suggestions. I recognize that this goes beyond the scope of the usual questions on this forum. If I come up with something that could be useful to others I will post it back to this forum. We can close out this thread.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.