aeroswat Posted December 7, 2009 Share Posted December 7, 2009 echo "<input type='checkbox' value='1' name='ordSupply' id='ordSupply' onclick='disChange('hidSupply');' " . ($ordSupply=='1' ? 'checked' : '') . "/>"; there is an error with my javascript function on this page. Is it because i have multiple sets of single quotes? Quote Link to comment https://forums.phpfreaks.com/topic/184316-is-this-bad-syntax/ Share on other sites More sharing options...
premiso Posted December 7, 2009 Share Posted December 7, 2009 This is bad syntax for Javascript/HTML: onclick='disChange('hidSupply');' As you are using single quotes inside of single quotes. Replace the below code in your code and it will fix your JS error: onclick=\"disChange('hidSupply');\" Quote Link to comment https://forums.phpfreaks.com/topic/184316-is-this-bad-syntax/#findComment-973080 Share on other sites More sharing options...
aeroswat Posted December 7, 2009 Author Share Posted December 7, 2009 Thankyou. Quote Link to comment https://forums.phpfreaks.com/topic/184316-is-this-bad-syntax/#findComment-973083 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.