Jump to content

onclick with if statement


abbos

Recommended Posts

Hi Everyone,

 

Complete newbie here so please be patient  :)

 

I am creating somthing similar to a cart page and cannot seem to get the following line to work:

 

echo "<td colspan=\"2\" align=\"right\"><form><input name=\"checkbox\" type=\"checkbox\" value\"showlabour\" onClick=\"if(CHECKED){$total=$totallinecost+$totallabourcost+$delivery}else{$total=$totallinecost+$delivery};\"></form>include labour</td>";

 

I want to put a checkbox on the page. If it is checked then it should do the first sum and then refresh the page, if it is unchecked it should do the second sum and refresh the page.

 

Am I completely off track or nearly there?

 

Thanks,

Abbos

Link to comment
https://forums.phpfreaks.com/topic/119554-onclick-with-if-statement/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.