The code works the first time around, the second time around only the checkboxes get clicked but no prompts
<label><input type="checkbox" name="install" <?php if(isset($_GET['install'])) { echo 'checked'; } ?>
id='install' value="Install" onchange="this.form.submit()"> Install & Comm</label>
<label><input type='checkbox' name='freight' <?php if(isset($_GET['install'])) { echo 'checked'; } ?>
id='freight' value='freight' onchange='this.form.submit()'> Freight Charges</label>
<label><input type='checkbox' name='discount' <?php if(isset($_GET['install'])) { echo 'checked'; } ?>
id='discount' value='discount' onchange='this.form.submit()'> Discount</label>
<script>
function getValueInstall() {
var installAmount = prompt("Enter Install Value");
if (installAmount>0) {
window.location.href = (window.location.href.split('?')[0]) + "? install=on + p1=install &installp2=" + installAmount;
} else {
window.location.href = (window.location.href.split('?')[0]) + "? p1=install& p2=" + installAmount;
}
}
document.getElementById("install").onclick = getValueInstall;
function getValueFreight() {
var freightAmount = prompt("Enter Freight Value");
if (freightAmount>0) {
window.location.href = (window.location.href.split('?')[0]) + "? freight=on + p1=freight &freightp2=" + freightAmount;
} else {
window.location.href = (window.location.href.split('?')[0]) + "? p1= & p2=" ;
}
}
document.getElementById("freight").onclick = getValueFreight;
function getValueDiscount() {
var discountAmount = prompt("Enter Discount Value");
if (discountAmount>0) {
window.location.href = (window.location.href.split('?')[0]) + "? discount=on + p1=discount & discountp2=" + discountAmount;
} else {
window.location.href = (window.location.href.split('?')[0]) + "? p1= & p2=" ;
}
}
document.getElementById("discount").onclick = getValueDiscount;
</script>