Forum Replies Created
-
AuthorPosts
-
Hi Alex,
Thanks for this info this resolved my issue!
that was it. complete oversight on my part. Thank you as always!
It is a normal SP 2013 custom list. The form is only customized with DFFS.
I even tried creating a brand new test list and get the same errors.
Hi Alexander,
Here is the console response
$(“table.ms-formtable”).length;
VM344:1 Uncaught TypeError: Cannot read property ‘length’ of null
at <anonymous>:1:24Sorry for the delay:
using the same code you provided in the topic
(function(){ var a = [], b = [], tt; a.push("<tr style='font-size:18px;color:green;'>"); a.push("<td colspan='2' style='padding:2px;'>"); a.push("<span id='elapsedTime'></span><span id='totalTime'></span>"); a.push("</td>"); a.push("</tr>"); $("table.ms-formtable").prepend(a.join("")); b.push("<span title='You can save and close the list item while the timer is running. It will keep tracking time until you edit the item and click \"Stop the timer\".'>"); b.push("<input style='background-color:#C2CF8A;color:#444;' type='button' id='dffsTimeTrackerStartBtn' value='Start the timer' onclick='startTicker()'>"); b.push("<input style='background-color:#D57C7C;color:#ffffff;display:none;' type='button' id='dffsTimeTrackerStopBtn' value='Stop the timer' onclick='stopTicker()'>"); b.push("<span> </span>"); b.push("</span>"); $("input[id$='_diidIOSaveItem']:last").before(b.join("")); tt = getFieldValue("TotalTimeString"); if(tt !== ""){ $("#elapsedTime").html("Total time: "+getFriendlyTime(Number(tt))); } })(); function startTicker(){ var a= getFieldValue("StartTimeString"); if(a === ""){ setFieldValue("StartTimeString",new Date().valueOf()); $("#dffsTimeTrackerStartBtn").hide(); $("#dffsTimeTrackerStopBtn").show(); $("#totalTime").html(""); } } function stopTicker(){ var a = getFieldValue("StartTimeString") , b = new Date().valueOf() , u = spjs.utility.userInfo(_spPageContextInfo.userId) , et = b-Number(a) , tt = Number(getFieldValue("TotalTimeString")) + et , log = getFieldValue("Log") , al = getFieldValue("Activity"); setFieldValue("TotalTimeString",Number(tt)); // Reset start time and log setFieldValue("StartTimeString",""); setFieldValue("Activity",""); if(a !== ""){ if(log !== ""){ log += "\n*******************\n"; } if(al !== ""){ al = "\n\nActivity log:\n"+al; } setFieldValue("Log",log+u.Title+"\nStart: "+new Date(Number(a)).toLocaleString(_spPageContextInfo.currentUICultureName)+"\nEnd: "+new Date().toLocaleString(_spPageContextInfo.currentUICultureName)+"\nElapsed time="+getFriendlyTime(et)+al); } $("#elapsedTime").html(""); $("#totalTime").html("Total time: "+getFriendlyTime(tt)); $("#dffsTimeTrackerStartBtn").show(); $("#dffsTimeTrackerStopBtn").hide(); } function getFriendlyTime(ms){ var h, m, s; h = Math.floor(ms / 3600000); m = Math.floor((ms % 3600000) / 60000); s = Math.floor((ms % 60000) / 1000); return (h<10?"0"+h:h)+":"+(m<10?"0"+m:m)+":"+(s<10?"0"+s:s); } if(getFieldValue("StartTimeString") !== ""){ $("#dffsTimeTrackerStartBtn").hide(); $("#dffsTimeTrackerStopBtn").show(); } setInterval(function(){ var a = getFieldValue("StartTimeString"), b = new Date().valueOf(), tt = Number(getFieldValue("TotalTimeString")); if(a !== ""){ $("#elapsedTime").html("Elapsed time: "+getFriendlyTime(b - Number(a))); if(tt !== ""){ $("#elapsedTime").append(" / Total time: "+getFriendlyTime(tt + (b - Number(a)))); } } },1000);
console message:
jquery.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/.When i delete any multi line text field i get no error.
Attachments:
September 19, 2017 at 18:58 in reply to: People Picker field shortens when using side by side settings #18216I figured out the CSS for SP2010
Div.ms-inputuserfield.ms-inputBox{ width:140px !important; }
This does not appear to work in my 2013 test site though.
- This reply was modified 7 years, 3 months ago by Leon Perdue.
- This reply was modified 7 years, 3 months ago by Leon Perdue.
September 19, 2017 at 17:21 in reply to: People Picker field shortens when using side by side settings #18213Sorry for the delay and thanks for the response!
when i removed
.sbs_FieldTable .dffs_tdWrap *{ width:auto !important; }
the rest of the side by side dont line up. I do see the people picker is a div. I will keep playing with the CSS and see if i can get the right width.
- This reply was modified 7 years, 3 months ago by Leon Perdue.
-
AuthorPosts