I'm smashing my head against the wall because of this problem.
I have a drupal site with a form cntaining a hidden field. Upon click on a div, I write a value into a hidden field which looks like this:
<input type="hidden" value="" name="field_body_image[und][0][value]">
And then I perform this JQuery:
$('input[name="field_klasse_tid[und][0][value]"').attr('value', tid);
Usually it works. But not for all users. Some users fail this simple task. Even
$('input[name="field_klasse_tid[und][0][value]"').val(tid);
fails for them. It is super weird, JQuery just seems to fail for some users, every other JQuery code on site works for them. What is it with these hidden fields? I hope some of you have an idea, because I'm running out of time : / Thank you!
Your jQuery selector is wrong - it has an open [
but not a close ]
.
$('input[name="field_klasse_tid[und][0][value]"').attr('value', tid);
It should be:
$('input[name="field_klasse_tid[und][0][value]"]').attr('value', tid);