Permalink
Browse files

Made the form result messages much more user friendly

  • Loading branch information...
1 parent 28c408c commit f5f0e1b11491b74729703bcda3c8c59989fe2a8e @Rican7 committed Feb 21, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 includes/Mobile/Feedback.php
@@ -40,15 +40,15 @@ public static function validate(&$postData, &$responseData, $ajax) {
$trimmed_data = trim($data);
if (empty($trimmed_data)) {
$responseData['error'] = true;
- $responseData['response']['title'] = 'Form Validation Error';
+ $responseData['response']['title'] = 'Whoops!';
$responseData['response']['message'] = 'Please fill in all fields';
}
}
// Validate the email address
if (!filter_var($postData['email'], FILTER_VALIDATE_EMAIL)) {
$responseData['error'] = true;
- $responseData['response']['title'] = 'Form Validation Error';
+ $responseData['response']['title'] = 'Whoops!';
$responseData['response']['message'] = 'Please enter a valid email address';
}
@@ -60,7 +60,7 @@ public static function validate(&$postData, &$responseData, $ajax) {
$hash = md5($postData['email'].$postData['timestamp'].$salt);
if ($hash != $postData['hash']) {
$responseData['error'] = true;
- $responseData['response']['title'] = 'Security Error';
+ $responseData['response']['title'] = 'Unauthorized';
$responseData['response']['message'] = 'Unauthorized request detected';
}
}
@@ -95,12 +95,12 @@ public static function submit(&$postData, &$responseData) {
if (\PSU::mail($mail_to, $mail_subject, $mail_message, $mail_headers)) {
$responseData['success'] = true;
$responseData['error'] = false;
- $responseData['response']['title'] = 'Feedback Sent Successfully!';
+ $responseData['response']['title'] = 'Success!';
$responseData['response']['message'] = 'Your feedback was submitted! Thank you!';
}
else {
$responseData['error'] = true;
- $responseData['response']['title'] = 'Feedback Processing Error';
+ $responseData['response']['title'] = 'Uh oh...';
$responseData['response']['message'] = 'There was a processing error. Please try again later.';
}

0 comments on commit f5f0e1b

Please sign in to comment.