Home › Forums › Classic DFFS › Can the form show column numbering?
- This topic has 8 replies, 3 voices, and was last updated 9 years, 5 months ago by Kristoffer Bertsch.
-
AuthorPosts
-
-
July 21, 2015 at 14:27 #7961
Hi, I have a few lists used for testing. We did some updating to our tests where we have now numbered each question. I would rather not update each column with a number in front of the question but instead have a number show on the form for each column/question. Is this possible?
I appreciate your help!
-Kris -
July 21, 2015 at 14:43 #7962
Kris,
Could you use the ID field? This would give you a number unique to the question. A danger would be that the questions would have to be entered in the correct order.
OR
Introduce another column for the Question Number, and show that ahead of the question on the form.John
-
July 21, 2015 at 14:55 #7963
Hi John,
I don’t like the 2nd option only because it kind of makes the form look sloppy. Also, I would need to incorporate some type of CSS to make the new number columns widths fit to the object in the column, which I am not good at.
The 1st option, are you referring to the SharePoint unique ID? Or the ID field in the backend for each column?
-Kris
-
July 21, 2015 at 15:03 #7964
Kris,
I was thinking of the unique ID that each record in a list has. It is usually hidden, but can be made available. The only time you can’t use it is when creating a record as the ID is only assigned once the record is saved. This may cause problems as you have no control over the number.
You could do something with the first option, by creating a third, calculated field which creates a composite of the question number and the question, e.g.
Q No Question Composite 1. What colour is the sky? 1. What colour is the sky?
Just a thought.
John
- This reply was modified 9 years, 6 months ago by JGMcLoughlin.
-
July 21, 2015 at 15:15 #7966
Hey John,
If I am thinking of the same Unique ID you are, that would keep counting and wouldn’t align once a test has been completed. Are you referring to an ID in the DFFS backend that can be made visible?
-Kris
-
July 21, 2015 at 15:25 #7967
Kris,
You are correct in thinking of the ID in the SharePoint list. Would make life difficult for you. How about my other idea?
John
-
July 21, 2015 at 15:32 #7968
I like the separate column idea, could you help with a custome CSS? For example if using a number field have it fit to the width of the text in the column so that it will align next to the question.
-
July 25, 2015 at 09:12 #7979
Hi,
Sorry for the delay. Here is a pure CSS example – found in this page: https://css-tricks.com/numbering-in-style/Add this to the Custom CSS in the backend:
.ms-formtable{ counter-reset: spjs-css-counter; } .ms-formtable h3:before { content: counter(spjs-css-counter); counter-increment: spjs-css-counter; font: bold 25px/1 Sans-Serif; }
This will number the columns from the top, so if you have some hidden columns you could use something like this in the Custom JS section to add the number to only the visible columns in JavaScript:
function customFieldNumber(){ spjs.$(".customFieldNumber").remove(); setTimeout(function(){ spjs.$("td.ms-formlabel:visible").each(function(i,td){ spjs.$(td).find("h3").prepend("<span class='customFieldNumber'>"+(i+1)+"</span>"); }); },1); } // On tab change spjs.$("li.tabBase").click(function(){ customFieldNumber(); }); // On page load customFieldNumber();
Style the new number in the Custom CSS like this:
.customFieldNumber{ font-size:25px; color:green; }
Alexander
-
July 29, 2015 at 13:31 #8017
Great! Thank you and thanks for sharing the link, it will come in very usefull!
-
-
AuthorPosts
- You must be logged in to reply to this topic.