Element values in element javascript

jh

Member
Hi

I am using an element on a search form, that is used to redirect to a selected details page. The element is a database join and the redirect plugin is set to jump to:

/details/10/{___fac_name_raw}

This works perfectly on pressing the submit button.

However, I want to use element javascript to submit on change. I have tried to use placeholders but believe they can not be used and have only got as far as:

event - change
location.replace("https://***/details/10/XX");

So what I want to know is how to get 'XX' (which would have been a placeholder value). Or if there is a better way of doing this rather than 'replace'.

Hope this makes sense. Thank you for any help.

Kind Regards
 
So you need to get the XX from the value of the element being changed? Or from a different element on the same form?

-- hugh
 
Hi

Yes, the XX should be the ID value of what the element is changed to. In this case the element is {___fac_name_raw}

Many thanks
 
OK, in which case this.getValue() should get you the value of the element the JS event is running on.

Code:
location.replace("https://***/details/10/" + this.getValue());
 
  • Like
Reactions: jh
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top