Steve Jonasson

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • in reply to: setDate based on another Date and time field #32510
    Steve Jonasson
    Participant

    It looks like I got it working:

    
    
    function endOfQuarantine() {
        let d = spjs.utility.getDateFieldAsDateObject('positiveSince');
        let dd = new Date(d);
        dd.setDate(dd.getDate()+14);
        let day = dd.getDate();
        let month = dd.getMonth()+1;
        let year = dd.getFullYear();
    
    let finalDate = (day +". "+ month + ". "+year);
    setFieldValue('positiveTo',finalDate);
    }
    in reply to: DFFS does not load in EditForm #31103
    Steve Jonasson
    Participant

    Thank you Alex, I figured it out.
    Field DFFS by SPJSBlog.com was in the content type set as “Hidden”.
    Now, it works perfectly.

    in reply to: Lock form after 09:00 #28795
    Steve Jonasson
    Participant

    Thank you Alex again, we’ve updated DFFS version to the latest. DateObject has started to work.
    Steo

    in reply to: Custom JS work in Google Chrome but not in IE11 #28793
    Steve Jonasson
    Participant

    You’re a magician Alex, thank you, it works perfectly. I hope it will help other people someday.
    Thanks.
    Steo

    in reply to: Number field validation to use dot and not comma #28716
    Steve Jonasson
    Participant

    Thank you, Alex, it helped me a lot.
    In Czech, we have comma separator instead of a decimal dot.
    And I changed the event from “keyup” to “change” and it works perfectly.
    Steo

    in reply to: Lock form after 09:00 #28470
    Steve Jonasson
    Participant

    Ok, I hope it won’t be complicated and not delete all configuration.
    I’ll let you know when I’m done.
    It will probably take some time.
    Thank you Alex,
    Steo.

    in reply to: Lock form after 09:00 #28464
    Steve Jonasson
    Participant

    This one:

    in reply to: Lock form after 09:00 #28459
    Steve Jonasson
    Participant

    Sorry, the output does not show anything. I should have added the attachment.

    in reply to: Lock form after 09:00 #28455
    Steve Jonasson
    Participant

    Thank you, Alex, so much.
    It is not working:

    
    
    var due = spjs.utility.getDateFieldAsDateObject("objNaDate");
    var todayAt0900 = new Date();
    todayAt0900.setHours(9, 0, 0);
    if (due < todayAt0900) {
        jQuery("#part1").hide();
        spjs.dffs.alert({
            "title": "No access",
            "msg": "This item is locked because the due date has passed.",
            "ok": function () {
                location.href = location.href.split("EditForm.aspx").join("DispForm.aspx");
            }
        });
    }

    Field Internal Name is OK. Developer console in Google Chrome does not show any errors.
    Thank you.
    Steo

    in reply to: Lock form after 09:00 #28449
    Steve Jonasson
    Participant

    I don’t understand exactly what you mean. Do you want to lock ALL items in the list at 09:00, or only those that have a due date on that same day?

    Only those that have a due date on that same day.

    And if the item has a due date “today” – locking it at 09:00 should keep it locked permanently?

    Yes, keep it locked permanently after “today” – 09:00.

    Steo

    in reply to: Custom JS count sum (€) #28409
    Steve Jonasson
    Participant

    Well, all columns have been set as “Number”. I set them as “one line of text” and it works out.

    in reply to: Custom JS count sum (€) #28406
    Steve Jonasson
    Participant

    The last thing, I cannot save the “item”, because of the value, for example: “0.7“, but in Czech, we have the value with a decimal point (comma) “0,7“. Can you help me?
    Otherwise, it works perfectly.

    Steo

    Attachments:
    in reply to: Custom JS count sum (€) #28400
    Steve Jonasson
    Participant

    Thank you Alex for pointing out the errors.
    Now, it works perfectly.
    Steo

    in reply to: Custom JS count sum (€) #28382
    Steve Jonasson
    Participant

    Hi Alex,
    I tried that and it worked perfectly. Then I made “tot” read-only and customized the JS function and it also worked followed by your instructions. But I need to sum 5 columns summed in “tot” column. So I have created 5 columns. “sumAll” is a column where it adds up.

    Here is my code:

    
    
    jQuery("#dffs__x0043_hK1000 input, #dffs__x0043_hK450 input,#dffs_RozStan50 input, #dffs__RozGrah60 input, #dffs_Vian350 input").on("keyup",function(){
        var str = jQuery(this).val().replace( /[^0-9.]/g, "" );
        jQuery(this).val(str);
        setFinalCost();
    });
    
    function setFinalCost(){
    	var a, b, c, d, e, f, aa, bb, cc, dd, ee, ff;
    	a = Number($("#dffs__x0043_hK1000 input").val());
    	b = Number($("#dffs__x0043_hK450 input").val());
    	c = Number($("#dffs_RozStan50 input").val());
    	d = Number($("#dffs_RozGrah60 input").val());
    	e = Number($("#dffs_Vian350 input").val());
    	f = Number($("#dffs_sumAll input").val());
    	aa = !isNaN(a) ? a : 0;
    	bb = !isNaN(b) ? b : 0;
    	cc = !isNaN(c) ? c : 0;
    	dd = !isNaN(d) ? c : 0;
    	ee = !isNaN(e) ? c : 0;
    	ff = !isNaN(f) ? c : 0;
    	
    	if(isNaN(a)){
    		alert("Number format error in \""+spjs.dffs.fieldData._x0043_hK1000.disp+"\"");
    	}
    	if(isNaN(b)){
    		alert("Number format error in \""+spjs.dffs.fieldData._x0043_hK450.disp+"\"");
    	}
    	if(isNaN(c)){
    		alert("Number format error in \""+spjs.dffs.fieldData.RozStan50.disp+"\"");
    	}
    	if(isNaN(d)){
    		alert("Number format error in \""+spjs.dffs.fieldData.RozGrah60.disp+"\"");
    	}
    	if(isNaN(e)){
    		alert("Number format error in \""+spjs.dffs.fieldData.Vian350.disp+"\"");
    	}
    	if(isNaN(f)){
    		alert("Number format error in \""+spjs.dffs.fieldData.sumAll.disp+"\"");
    	}
    	setFieldValue("Tot",aa+bb+cc+dd+ee+ff);
    	setTimeout(function(){
    		$("input.fieldValueUpdated").removeClass("fieldValueUpdated");
    	},1000);
    }

    Thank you in advance.
    Steo

    in reply to: Rename Add/remove buttons with description #26769
    Steve Jonasson
    Participant

    Thank you so much Alex, it helped me a lot.
    Thank you
    Steve

Viewing 15 posts - 1 through 15 (of 24 total)