Topic awaiting preservation: help me please |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: Czech Republic via Bristol UK |
posted 06-22-2010 00:14
bah humbug even with the code tags this gets screwed up in formatting code: <form method="POST" action="<?php echo $editFormAction; ?>" name="single_payment" target="_self" id="single_payment"> <p>Select Payment Type below:</p> <p>One time payment</p> <p>Cost:<input name="amount" type="text" id="amount" value="<?php echo $row_Recordset3['course_cost']; ?>" readonly="true" /> <label for="one_time_payment"></label> <input name="date_due" type="hidden" id="date_due" value="<?php echo $row_Recordset3['date_to_limit']; ?>" /> <input name="payment_reason" type="hidden" id="payment_reason" value="<?php echo $row_Recordset4['course_type']; ?>" /> </p> <p>Student paying now? <script type="text/javascript"> function check_paid() { var form = document.getElementById("payment_recieved"); var date_recieved = document.getElementById("date_recieved"); var currentTime = new Date() var month = currentTime.getMonth() + 1 var day = currentTime.getDate() var year = currentTime.getFullYear() if(form.payment_recieved.checked!=true){ form.date_recieved.value = year + "-" + month + "-" + day; alert:(this.form.date_recieved.value) form.payment_recieved.focus(); }else{ form.date_recieved.value = ""; form.submit(); } } </script> <input name="payment_recieved" type="checkbox" id="payment_recieved" value="'Y'" onclick="check_paid(single_payment);"/> <label for="payment_recieved"></label> <input name="date_recieved" type="hidden" value="0000-00-00" /> <p> <input type="submit" name="submit" id="submit" value="Enter Single payment into system" /> </p> <input type="hidden" name="MM_insert" value="single_payment" /> <input name="student_id" type="hidden" id="student_id" value="<?php echo $row_Recordset1['student_id']; ?>" /> </form>
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 06-22-2010 08:23
sorry about that? |
Paranoid (IV) Inmate From: Czech Republic via Bristol UK |
posted 06-22-2010 17:47
hiya tp i think this should get you http://pastebin.com/f69nQXCx |
Paranoid (IV) Inmate From: Czech Republic via Bristol UK |
posted 06-23-2010 08:32
http://pastebin.com/4RK3nJGe |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 06-23-2010 18:28
ok, so the checkbox can either transmit an empty value, or "'N'" if it is checked... is that what you want? |
Paranoid (IV) Inmate From: Czech Republic via Bristol UK |
posted 06-23-2010 20:22
check paid is being done onclick, |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 06-24-2010 00:26
ok, seperate the checkbox from the value being transmitted, take a hidden value for that - that's always transmitted, the checkbox only get's transmitted if it's checked, so it's either 'N' or NULL/unset, and do it in the form's onsubmit handler instead of onclick, returning false if you don't want the form to be submited - this also stops your user from just hitting enter and submitting it anyway. |
Paranoid (IV) Inmate From: Czech Republic via Bristol UK |
posted 06-24-2010 01:20
cheers bud will give it a go will let ya know how i get on thx for the help |