Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkPostage(){
- var parcelweight = $('input[name=parcelweight]').val();
- var parceltype = $('#parceltype').find(":selected").text();
- var success = true;
- if (parceltype == "Letter"){
- if (parcelweight <= 100){
- removePostalError();
- return success;
- }else{
- addPostalError();
- success = false;
- return success;
- }
- }else if (parceltype == "Large Letter"){
- if (parcelweight <= 750){
- removePostalError();
- return success;
- }else{
- addPostalError();
- success = false;
- return success;
- }
- }else if (parceltype == "Small parcel"){
- if (parcelweight <= 2000){
- removePostalError();
- return success;
- }else{
- addPostalError();
- success = false;
- return success;
- }
- }else if (parceltype == "Medium parcel"){
- if (parcelweight <= 20000){
- removePostalError();
- return success;
- }else{
- addPostalError();
- success = false;
- return success;
- }
- }else if (parceltype == "Large parcel"){
- // Any weight is OK for large parcels
- removePostalError();
- return success;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement