SOLVED - confirm() with textarea submission
Posted: Wed Feb 18, 2004 12:21 pm
I'm trying to use a confirm() with a textarea box, where the the value of the text gets added to the db. My problem is that I type text into the text box, but it never seems to get submitted. I am completely lost, if anyone has any suggestions, I am open to any help you can offer.
Here is the entire code for the page:
I know my documentation sux, but it should be pretty easy to figure out what's going on. The problem is with submitting the text in the textarea. I am unable to pass that on for some reason. Thanks for the help.
Here is the entire code for the page:
Code: Select all
<?php
<?
include "../db_connect.php3";
?>
<html>
<head>
<SCRIPT LANGUAGE="Javascript">
<!---
function decision(oid,cust) {
ok = "/control/cancel_order.php3?a=cancel&OrderNumber=" + oid;
cancel = "/control/view_order.php?oid=" + oid + "&CustNum=" + cust;
answer = confirm("Do you really want to cancel this order?");
if (answer) {
location = ok;
} else {
location = cancel;
}
}
// --->
</SCRIPT>
<title>Discount Dance Supply Order Cancellation</title></head>
<body bgcolor=#ffffff>
<center>
<br>
<table border=1 cellpadding=0 cellspacing=0>
<tr>
<td colspan=7 bgcolor=#6666cc align=center>
<font face=verdana,arial,helvetica size=-1 color=#ffffff><b> Discount Dance Supply Order Cancellation </b></font>
</td>
</tr>
<tr>
<td valign=top align=center>
<?
if($OrderNumber && $a=="cancel") {
$Notes = $_POST[Notes];
$cancel_handle=mysql_db_query($db,"INSERT into Order_Status_Header values (0,$OrderNumber,$OrderNumber,0,now(),'','','','$Notes')");
#$cancel_handle2 = mysql_db_query($db, "UPDATE Order_Header SET DownloadBatch=1 WHERE OrderNumber=$OrderNumber");
}
?>
<form method=POST name=addressForm>
<table border=0 cellpadding=2 cellspacing=0>
<tr>
<td valign=top><font face=arial,helvetica style="font-size: 9pt;">
<?
if($OrderNumber) {
$status_handle=mysql_db_query($db,"SELECT StatusNumber from Order_Status_Header where OrderNumber=$OrderNumber and AdvantageFlag=11");
$download_batch = mysql_db_query($db, "SELECT DownloadBatch FROM Order_Header where OrderNumber=$OrderNumber and DownloadBatch=1");
if ((mysql_num_rows($status_handle) >0) || (mysql_num_rows($download_batch)) > 0 ) {
echo "<b>Order has been cancelled</b>\n";
}
else {
echo "Notes for customer display <br><textarea cols=30 rows=4 name=Notes></textarea>\n";
}
}
?>
</td>
</tr>
<tr><td align=center colspan=2><input type=submit name="SaveChanges" value="Cancel Order" style="font-size:8pt;" ONCLICK=" decision('<? echo $OrderNumber; ?>','<? echo $CustNum; ?>'); return false;"></td></tr>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
?>