Hope someone can help me on this as I cannot figure out what I'm doing wrong. I have checked different posts but I cannot find anything different of what I'm already trying.
My model has an attribute:
private boolean thisShouldBeTrue;
The value of this should dynamically change depending on user's actions on the screen. My form contains a hidden input to retrieve this value:
<form:input path="thisShouldBeTrue" type="hidden" id="retrievedValue" />
Different javascript functions show this working since I retrieved different values on submission when the user makes some action to trigger those scripts.
However, I cannot set this to true on page load (this is the value that should be sent by default if user take no other action).
$(document).ready(function(){
$('#retrievedValue').val("true");
});
Any suggestions?
you just need to use
#for selecting html element with id using jquery, see below