I have a version 10.3 project that lets customers submit a courier request and the data resides in a MSSQL server database. The customer goes directly to an add page that they fill out 8 required fields, and 2 optional fields and then they hit submit. On the events page for the add Page, I have an "Javascript onload event" that sets the tab order and also sets the max length of one of the fields to 500 characters.
$("input[id^='value_Requestor_Name']").attr('tabindex', 1);
$("input[id^='value_Requestor_Email']").attr('tabindex', 2);
$("input[id^='value_Requestor_Phone']").attr('tabindex', 3);
$("select[id^='value_Pickup_Location']").attr('tabindex', 4);
$("select[id^='value_Destination_Location']").attr('tabindex', 5);
$("input[id^='value_Earliest_Pickup_Date']").attr('tabindex', 6);
$("input[id^='value_Latest_Pickup_Date']").attr('tabindex', 7);
$("input[id^='value_Item_Weight']").attr('tabindex', 8);
$("input[id^='value_Item_Size']").attr('tabindex', 9);
$("textarea[id^='value_Details']").attr('tabindex', 10);
var ctrlDetails = Runner.getControl(pageid,'Details');
ctrlDetails.on('keyup',function(e, argsArr){
var len = this.getValue().length;
if (len > 500)
{
alert("Maximum length allowed: 500.");
this.setValue(this.getValue().substring(0, 500));
}
});
I also have an After record added script that sends an email and notifies the user that their request was successful.
//********** Send email with new data ************
$email=$values['Requestor_Email'];
$from="central.stores@greececsd.org";
$msg="Thank you for using the electronic courier request submission form. We have received your request and will expedite promptly. The details of your request are in the email below"."\r\n\n";
$subject="Your New Electronic Courier Request";
$msg.= "Name: ".$values['Requestor_Name']."\r\n";
$msg.= "Email: ".$values['Requestor_Email']."\r\n";
$msg.= "Request Number: ".$values['Request_Number']."\r\n";
$msg.= "Date needed: ".$values['Latest_Pickup_Date']."\r\n";
$msg.= "Pickup from: ".$values['Pickup_Location']."\r\n";
$msg.= "Deliver to: ".$values['Destination_Location']."\r\n";
$msg.= "Request: ".$values['Details']."\r\n";
$ret=runner_mail(array('to' => $email, 'bcc' => 'central.stores@greececsd.org', 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
echo "<script>alert('Thank you for using the Courier Request System, your request number is: ".$values['Request_Number']."')</script>";
I have some users that when they click the submit button, the screen refreshes, but they do not get the successful request message. The database in the background increases the next available PK field by one, but no record is added to the database.
$("input[id^='value_Requestor_Name']").attr('tabindex', 1);
$("input[id^='value_Requestor_Email']").attr('tabindex', 2);
$("input[id^='value_Requestor_Phone']").attr('tabindex', 3);
$("select[id^='value_Pickup_Location']").attr('tabindex', 4);
$("select[id^='value_Destination_Location']").attr('tabindex', 5);
$("input[id^='value_Earliest_Pickup_Date']").attr('tabindex', 6);
$("input[id^='value_Latest_Pickup_Date']").attr('tabindex', 7);
$("input[id^='value_Item_Weight']").attr('tabindex', 8);
$("input[id^='value_Item_Size']").attr('tabindex', 9);
$("textarea[id^='value_Details']").attr('tabindex', 10);
var ctrlDetails = Runner.getControl(pageid,'Details');
ctrlDetails.on('keyup',function(e, argsArr){
var len = this.getValue().length;
if (len > 500)
{
alert("Maximum length allowed: 500.");
this.setValue(this.getValue().substring(0, 500));
}
});
I also have an After record added script that sends an email and notifies the user that their request was successful.
//********** Send email with new data ************
$email=$values['Requestor_Email'];
$from="central.stores@greececsd.org";
$msg="Thank you for using the electronic courier request submission form. We have received your request and will expedite promptly. The details of your request are in the email below"."\r\n\n";
$subject="Your New Electronic Courier Request";
$msg.= "Name: ".$values['Requestor_Name']."\r\n";
$msg.= "Email: ".$values['Requestor_Email']."\r\n";
$msg.= "Request Number: ".$values['Request_Number']."\r\n";
$msg.= "Date needed: ".$values['Latest_Pickup_Date']."\r\n";
$msg.= "Pickup from: ".$values['Pickup_Location']."\r\n";
$msg.= "Deliver to: ".$values['Destination_Location']."\r\n";
$msg.= "Request: ".$values['Details']."\r\n";
$ret=runner_mail(array('to' => $email, 'bcc' => 'central.stores@greececsd.org', 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
echo "<script>alert('Thank you for using the Courier Request System, your request number is: ".$values['Request_Number']."')</script>";
I have some users that when they click the submit button, the screen refreshes, but they do not get the successful request message. The database in the background increases the next available PK field by one, but no record is added to the database.