I am getting a little frustrated and I know I have probably ballsed my code up but here goes.
I have a select dropdown that populates it's options with user id's, the select dropdown has a default value which I am trying to not use in the query.
I then want a chosen select option to populate a hidden text input with the selected user id from the option value.
So the code is detecting a change on the select, then it is saying if not default then copy value (user id) into the desired text input.
Here is my messy attempt at the jquery code, sorry for probably making a lot of mistakes with it.
jQuery(document).ready(function($){
$('.client-select').on('change',function(event){
if $('.client-select').val($(this) =! "default"){
$('.clientuserid').val($(this).find('option:selected').value());
}
});
});
Any help with this would be greatly appreciated.
Many thanks.
Charlie