I want to store a javascript onclick function code into a string first and then i need to pass it in a radio button.
My sting variable is:
$jsFunc = "onclick=\"javascript:showHide(this.value, \'$arrFlipEntities[$field_id]\');\"";
I want to use this variable like dis:
$strCode .= "<input {$jsFunc} type=\"radio\" name=\"{$field_name}\" id=\"{$option}\" value=\"{$option}\" checked=\"checked\"/><label for=\"{$option}\">{$option}</label>";
But it is giving this output, when i viewed the source code:
<input onclick="javascript:showHide(this.value, \'bas_link\');" type="radio" name="bas_type" id="Yes" value="Yes" checked="checked">
when ‘ is in two “,it doesn’t need \