I am using an onclick function in my html (so not a method, but the javascript code itself in the html button onclick event).
How do I add 2 statements in the 1 line after an IF statement, that is not surrounded by curly braces.
I want to do something like this
onclick="javascript: if ( days.value == '' ) alert('Please select at least 1 day to schedule this report') && return false;"
I can't use the curly braces to enclose the two statements because I can't find any information on outputting a curly brace into a string in PHP (If i do, the output stops after the first curly brace)
My PHP looks like this:
$content["PREPEND"].= " onclick=\"javascript: if ( days.value == '' ) alert('Please select at least 1 day to schedule this report') && return false; \"";
I tried using the &&, but that doesnt work. Any advise appreciated!