Apologies for the very basic question - crash course in javascript coming up! But before that, I have a javascript function:
function toggle(request)
The function simply toggles a div as visible/invisible. I can trigger the behaviour I want from this function using an onclick event as follows:
<input type="radio" name="complete" value="true" id="complete_yes"
onclick="toggle('true');"/>
This works fine, but after posting a form, under certain conditions I want the radio button to be automatically selected and the javascript function to be automatically set to:
toggle('true')
... thus revealing the div contents. I've got the "checked" part working, but how do I get the javascript function to conditionally be set to true aswell?
<input type="radio" name="complete" value="true" {if $data.complete == true}checked{/if} id="complete_yes"
onclick="toggle('true');"/>