Subversion Repositories SmartDukaan

Rev

Rev 32328 | Rev 32468 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32328 Rev 32329
Line 256... Line 256...
256
 
256
 
257
function validateOrderDetails() {
257
function validateOrderDetails() {
258
    var sNumbers = [];
258
    var sNumbers = [];
259
    var error = false;
259
    var error = false;
260
    $("form#cd input.serialNumber").each(function () {
260
    $("form#cd input.serialNumber").each(function () {
261
        var input = $(this).val().trim();
261
            var input = $(this).val().trim();
262
        var itemType = $(this).attr("itemType");
262
            var itemType = $(this).attr("itemType");
263
        $(this).removeClass("border-highlight");
263
            $(this).removeClass("border-highlight");
-
 
264
            if (itemType !== 'SERIALIZED') {
-
 
265
                return;
-
 
266
            }
264
        if (sNumbers.indexOf(input) != -1 || (itemType === 'SERIALIZED' && !input)) {
267
            if (sNumbers.indexOf(input) !== -1 || (itemType === 'SERIALIZED' && !input)) {
265
            error = true;
268
                error = true;
266
            $(this).addClass("border-highlight");
269
                $(this).addClass("border-highlight");
-
 
270
            }
-
 
271
            sNumbers.push(input);
267
        }
272
        }
268
        sNumbers.push(input);
273
    )
269
    });
274
    ;
270
 
275
 
271
    $("form#cd input.unitPrice").each(function () {
276
    $("form#cd input.unitPrice").each(function () {
272
        var input = $(this).val().trim();
277
        var input = $(this).val().trim();
273
        $(this).removeClass("border-highlight");
278
        $(this).removeClass("border-highlight");
274
        if (!input || parseInt(input) <= 0 || isNaN(input)) {
279
        if (!input || parseInt(input) <= 0 || isNaN(input)) {