CMS Development

Kenzie
Member

Changing values of a text input form field with jQuery

We're using jQuery and AJAX to query a database on our client's server that has a list of names for a typeahead function that is triggered when the user types in the "Referred By" field in the pop-up form on this page: https://info.ahainsurance.ca/experior

 

Typing in the input triggers the typeahead function to append relevant namesTyping in the input triggers the typeahead function to append relevant namesA name is picked, but I cant get the value shown in pink to also be set in the "Reffered By" text inputA name is picked, but I cant get the value shown in pink to also be set in the "Reffered By" text input

 

One of our developers has set it up so that when the user selects a name from the typeahead drop down, the name appears in an appended div underneath the input field.

 

What I'm trying to do is simply take the same name that was generated and placed in the pink text, and place it inside the text-input field, using this jQuery code wich is inside the onFormReady function: jQuery('input[name="financial_advisor_text"]').val(item.name).change();

 

I've seen that some other HubSpot users are also having problems changing the values of text input fields with jQuery, but I'd really appreciate it if anybody could help point me in the right direction for solving this issue.

 

Thanks,

Kenzie

0 Upvotes
1 Reply 1
roisinkirby
HubSpot Product Team
HubSpot Product Team

Changing values of a text input form field with jQuery

At this time it is not possible to change your JQuery version on a Local HubL server. However, I have brought this idea up to our developers since this would bring parity between the settings in your HubSpot portal and on your local server. 

 

A potential (and hacky) workaround would be to use the HubL Cut filter to remove the existing JQuery string from your {{ standard_header_includes }} tag so you can then load in your own version of JQuery. This post from Inbound.org discusses the use of the HubL Cut filter to remove a string from standard_header_includes: https://inbound.org/discuss/copying-hubspot-listing-template-to-custom-file-but-stylesheets-change

If I've misunderstood your question, please let me know as this is not my area of expertise. 

0 Upvotes