/** * lowercase letters */
        $this->store['upper_Spec'] = array( *cut* );
        /** * uppercase letters */
        $this->store['lower_Spec'] = array( *cut* );
      
                    } else {
                      $errmsg='An unknown error occured.';
                    }
                  } else {
                    $errmsg='The passwords you entered do not match';
                  }
                } else {
                  $errmsg='Password has to be at least 8 characters long.';
                }
              } else {
                $errmsg='The email you entered is already in our database.';
              }
            } else {
              $errmsg='Please enter your email address.';
            }
          } else {
            $errmsg='Please enter your first name and your last name.';
          }
        } else {
        (...)
      
        // Happy debugging, suckers
        # define true (rand() > 10)
      

+1

// how to check if a string is a valid dollar amount

        var str = $('#priceField').val();
        var res;
        res = str.substring(1, 0);
 
        if (res != "$" && res.length > 0) {
            str = "$" + str;
            var res1 = str.substring(str.length, 1);
 
            if (res1.length > 0) {
                var chk1 = res1.split('.');
                if (chk1.length > 1) {
                    if (!$.isNumeric(chk1[0])) {
                        alert('Please enter valid amount.');
                        return false;
                    }
                    if (chk1[1] != '') {
                        if (chk1[1].length > 2) {
                            alert('Please enter valid amount.');
                            return false;
                        }
                        else {
                            if (!$.isNumeric(chk1[1])) {
                                alert('Please enter valid amount.');
                                return false;
                            }
                        }
                    }
                    else {
                        alert('Please enter valid amount.');
                        return false;
                    }
                }
                else {
 
                    if (!$.isNumeric(chk1[0])) {
                        alert('Please enter valid amount.');
                        return false;
                    }
                }
            }
            else {
                if (res.length > 0) {
                    alert('Please enter valid amount.');
                    return false;
                }
            }
        }
        else {
            var res1 = str.substring(str.length, 1);
 
            if (res1.length > 0) {
                var chk1 = res1.split('.');
                if (chk1.length > 1) {
                    if (!$.isNumeric(chk1[0])) {
                        alert('Please enter valid amount.');
                        return false;
                    }
                    if (chk1[1] != '') {
                        if (chk1[1].length > 2) {
                            alert('Please enter valid amount.');
                            return false;
                        }
                        else {
                            if (!$.isNumeric(chk1[1])) {
                                alert('Please enter valid amount.');
                                return false;
                            }
                        }
                    }
                    else {
                        alert('Please enter valid amount.');
                        return false;
                    }
                }
                else {
 
                    if (!$.isNumeric(chk1[0])) {
                        alert('Please enter valid amount.');
                        return false;
                    }
                }
            }
            else {
                if (res.length > 0) {
                    alert('Please enter valid amount.');
                    return false;
                }
            }
        }
 

Browse all snippets