wwwfilmfilercom
Aug 31st, 2008, 03:39 PM
Hi,
I really need to help fixing this horrible piece of code which is all over the place. All it does is run a javascript function to check/uncheck my boxes on my form.
However, because the js quotes need to be single, and the echo quotes are double I've just made it into this crazy chunk of code!
//SHOWS THE CHECK ALL/UNCHECK ALL BOXES
echo '</table><input type="button" onclick="SetAllCheckBoxes(';
echo "'killform', 'killed[]', true);";
echo '" value="Select all" /><br /><br /><input type="button" onclick="SetAllCheckBoxes(';
echo "'killform', 'killed[]', false);";
echo '" value="Deselect all" /><br /><br /><input type="submit" name="kill" value="Kill" /></form>';
I agree, it looks terrible.
Ideally, it would be great if I could have it all in a link - such as a href=javascript... etc.
How can I clean this up?? Thanks for any help!!!:thumb:
I really need to help fixing this horrible piece of code which is all over the place. All it does is run a javascript function to check/uncheck my boxes on my form.
However, because the js quotes need to be single, and the echo quotes are double I've just made it into this crazy chunk of code!
//SHOWS THE CHECK ALL/UNCHECK ALL BOXES
echo '</table><input type="button" onclick="SetAllCheckBoxes(';
echo "'killform', 'killed[]', true);";
echo '" value="Select all" /><br /><br /><input type="button" onclick="SetAllCheckBoxes(';
echo "'killform', 'killed[]', false);";
echo '" value="Deselect all" /><br /><br /><input type="submit" name="kill" value="Kill" /></form>';
I agree, it looks terrible.
Ideally, it would be great if I could have it all in a link - such as a href=javascript... etc.
How can I clean this up?? Thanks for any help!!!:thumb: