In my survey I use JS to autopopulate a question with the user's name using token values. I've realised that if the user hits Next on this page, then returns to it, this JS will overwrite any changes they may have previously made to their name. So I would prefer to autofill the question (short text answer) on page load
only if the question has not already been answered.
Below is the script I tried - the trouble is, the answer isn't empty because of something EM is doing. Its value is
<span id='LEMtailor_Q_524_30'></span>
. How can I overcome this?
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
if("{INSERTANS:48965X62X524}" == "") {
$('#answer48965X62X524').val('{TOKEN:FIRSTNAME} {TOKEN:LASTNAME}');
}
});
</script>
I'm using the latest Version 1.92+ Build 120919 and my survey is group by group. I haven't yet got around to figuring out EM as I'm trying to resurrect an old survey and get it live as soon as possible.