Post requests and questions in this post, but be patient awaiting reply or solution examples. This is a “one man blog” and i have limited time to answer questions. There will be less activity during the summer months, but i will keep posting new solutions, only on a slightly smaller scale.
I’m open to requests!
I get many ideas on things to write about from my readers, feel free to make requests on things you would like to learn more about.
I will, from the best of my knowledge (and time), answer your questions.
Post requests as comments to this post.
Use the rating on the request to vote them up, thus “forcing” me to answer them…
The comments are split into pages with 25 top level comments per page, and the last page displayed by default. Use the links at the bottom of the page to read older comments.
First and foremost thanks for everything you have posted!
As you know on all list views and document views, the view selector is on the right hand side of the menu bar. This can make it quite cumbersome for users looking at lists with many columns to change the view. A better option would be for the view selector to be on the left hand side and right hand side of the menu bar. I know I can move the view selector via SPD but would rather use a JavaScript options if one was available. Would this be something you would be interested in creating?
Thanks
tecrms
Hi tecrms,
Thank you for a very clever question! It’s often harder to think out the question than to actually solve the issue.
You find the solution here:
Move view selector to the left
Regards
Alexander
Hi Alexander:
Your work may be fun for you but it’s a gift for us. Thank you!
A small item: I need to hide the “Check Names” and the “Browse” icons on a NewForm or EditForm “People-Picker”.
Thanks-
Charlie Epes
Hi Charlie,
This one is small enough to post directly here. The FieldInternalName of the field to hide these elements on is “Responsible”:
Alexander
Thank you Alexander:
Hiding the “People Picker” icons worksd perfectly.
Charlie Epes
I have a similar request but only need to hide the “check names” icon. is it possible to split this out using your script?
@Nancy:
replace line 6 with this
$(fields[‘Responsible’]).find(‘.ms-usereditor td a:first’).hide();
[/sourceocde]
didn’t come thru clean, may have been me
Hey Alexander,
I currently have a MS Word based form that contains a 2 column by 10 row table where users provide up to 10 keycodes and their corresponding descriptions. I am hesitant to make 20 sharepoint variables to capture this since it will make a mess of the form – and I don’t need to query or report on these fields. Instead I’m looking for a possible solution for pre-populating a rich text field with a table template including column names. This way when a user creates a new item, they will see the familiar table and simply fill it in as per usual.
Not sure if its possible but you have really amazed me so far so figured I’d ask =)
Many thanks,
Marc
Hi Alexander:
Peter Allen of Bits of SharePoint uses JQuery to give a preview of an item in a calendar. Do you think you could do something similar (or with a pop-up tool) if I hover over a versioned multi-line text field’s “View Entries” link in a List?
http://www.bitsofsharepoint.com/ExamplePoint/Site/Calendar.aspx
Charlie Epes
Hi Charlie,
It was actually Paul Grenier who wrote the article. I had not thought about that solution – it was clever.
I have tested his solution and rewritten it to adapt it to pop-up on mouse-over (floating), and to preview only selected values – like what you request. I will post it during the weekend (if i get the time…).
Alexander
Hi Charlie,
Here is my modified solution:
Preview metadata in list view on mouseover.
Alexander
Marc,
Your request is answered here:
Collect input from custom input fields and store in multiline plain text field
Alexander
is there a way to run an sql query and populate a sharepoint list? I have found myself going around my ass to get to my elbow with this. currently i have a sharepoint list as a linked table. I run a query in access to build another table, then run a macro to delete the SP list, another macro to make table in SP list. There has to be an easier way to pull data from a database and upload to SP.
Hi Larry,
I cannot help you with querying other resources than SharePoint lists. “My” queries uses SharePoint web services for the querying.
Alexander
Thanks for responding. If you come across any resources related to this, please let me know.
I have another request, a dynamic quick launch with cookies. this post came close, but too many issues with the script.
http://blog.thekid.me.uk/archive/2007/12/04/updated-dynamic-left-navigation-width-for-sharepoint.aspx
i liked the functionality, but too buggy
What kind of functionality do you have in mind? Just a widening of the quick launch?
Alexander
What I believe to be a useable functionality would be that is has a way to click (the small space beween QL and Content) and drag to the width of user choice. A double here to close it completely, and a final double click on the left, where it has closed, to open back to the size set by the end user. all this also rememberd by cookies upon return to the site ( the defined width by user).
Hi Alexander:
Is there a way to hover over the Title field (or perhaps the Edit icon) in a default List view and have the EditForm pop-up so that the user can edit right then and there?
Thanks-
Charlie Epes
Hi Charlie,
I think it would be possible, but I’m not sure how elegant it would be, as the page would have to refresh to display the new information.
Look at the preview-solution you requested above over the weekend and see if it can be adapted to fill your need.
Alexander
Hi Charlie,
See if you can adapt this solution to your need – it will require some tweaking though.
Let me know if you need some guidance.
Alexander
There are lots of actions that can be performed by Sharepoint when the conditions of a workflow are met such as sending an email to a user, deleting the item and updating a field of an item. But one thing missing is the ability for the workflow to send the item to a printer automatically. We have a list that we use to enter in sales orders and we would really like sharepoint to send the order to a printer when certain fields equal certain values. Is there a script that can be written to do this?
Hi Matt,
I do not have a solution for responding to a change made by a WF, but if the “final” change is made in EditForm, it’s no problem to open the Print Dialog from there.
Alexander
Thanks Alexander. I’ll try out the first solution and let you know about the 2nd.
Charlie Epes
First off you rock! I have learned a lot by following your blog. The question I have is how could you re size the plain text fields so they don’t go the width of the form?
This is something that plagues me and probably everyone else trying to customize those pesky forms.
Also I am trying to figure how to get the quick launch horizontal instead of on the left of the screen.
Thanks in advance.
Hi Mark,
The width of the text field (both single line and multi line) can be set like this:
Alexander
How can I add this function together with Dynamic Forms, cause I’d inserted in CEWP and on IE8 worked right, but on Google Chrome was not rendered
Answered here: https://spjsblog.com/2013/08/12/dynamic-forms-for-sharepoint-v3/#comment-15483
Alexander
Thanks
Good Day Alexander, thanx for the shout out on the alignment.
I ran into an issue today and I am lost. I am not sure how to handle it. I am building a form using a few of your scripts. It is an internal form for my company. Many people do not have admin access to their machine so I figured they could not turn off JavaScript. Well the project owner has JS disabled and I am not sure yet if they can enable it.
My request: is there a way to display a message on the page that says JavaScript is disable, blah, blah , blah… without using JavaScript? almost like the old noscript tags used in html.
Never mind, I answered it myself. the noscript tags work if you place them in a CEWP.
New request. I ahve noticed at the end of each of your script there is a function “function init_fields()”. if implementation several of your script, can this be added to the page one time, at the end?
I know your busy, so I just remove the beginning and ending part of all codes and placed it one time on thr page. appears to be working, will need more testing
Hi,
Yes, it only needs to be added once. In the top of the script like this:
fields = init_fields();
This makes an object of all fields which can be addresses by it’s FieldInternalName. Containing the “tr-tag” and it’s content for that field.
The function can be added anywhere on the page or in an external file.
Alexander
Thanks Alex I really appreciate all you help.
Hi Alex,
The script for resizing the text fields works perfectly.
I have another request. I am trying to get my form to to display in tabs. The form has 40 fields and it needs to be split between 4 tabs like a wizard. Any help would be greatly appreciated.
Have you looked at this script: Dynamic expand/collapse fields or array of field.
You could expand each section by click on a “Yes/No” field above each section. You would have to modify the script, but the basics are described in the post.
Alexander
As if I dont make enough requests. lol Is there a way to create a view or list that display the sites List and Libraries, with a link back to them, if the permissions are inherited from the parent (this links back to the permissions of that list/library) and the date of last modified?
So 3 columns, List/library Name, permissions inherited Yes/No, and dat Last modified. On a side note is there a way to make this a roll up, having this for each sub site, that roles up to the top level.
Hi,
Sorry, but i have no such solution. It is possible, I’m sure, but i do not – as for now – know how to do it.
You could look at the web services sites.asmx and lists.asmx. The list of lists and document library’s should not be a problem, but the inheritance and lastmod, I’m not sure about.
Alexander
Hi Alexander:
When a user attaches a document to an item in a List, the attachments are stored in a hidden document library with the List Item ID as the Library name. The user cannot get to the library, as one would get to a normal Document Library.
Can you think of a way, from a List, to easily attach documents to a visible Document Library and then create and keep an automatic link to the List Item?
Thanks
Charlie Epes
Hi Alexander:
Is it possbile for you to create some code that would hide some of the toobar menu items such as New, Actions, Settings, Views or any of their sub menu selections based on a created permission level (Site Settings > Permissions > Permission Levels) ?
For instance if I created a new permission level called “Director” which is tagged to a user or group, I would like for them to have tailored menu functions in a list or library based on this new permission level…hope this makes sense
thanks.
Hi,
I have no method for hiding menu items based on permission levels, but hiding by group membership is possible. I have written a short article here: Hide menu items in list view toolbar and views in view selector.
Alexander
Thanks!
Good day Alexander, Todays request, amoung the many others :), is there a way to add a function (either by adding a button or an onchange event) that could clear (reset) a predefined set of fields? Example: I am using you script to dynamically hide/show groups of fields. Say today I have 3 groups I show and populate these fields. If somthing changes ion the project tomorrow and I only have 2 groups now, hiding the fields does not remove the field contents. I would like to add a button near the groups of fields that only removes that group of fields contents and does not touch any other part of the form.
Can this be done?
Hi Larry,
I believe this is answered in your other question
here.
Alexander
Hello Alexander,
Firstly thanks for this terrific materal – you have a great gift for educating.
Keping with the excellent discipline of maintaining a library of scripts in a SP library, is there a way to add an “open with” option to the file context menu so the scripts can also be edited in SP (using for example notepad++). Currently , clicking a .js file will try to execute it.
This has uses elsewhere where the associated application is not on the standard list.
cheers.
Hi,
Interesting idea, I will look into this, but i have no answer right now.
Alexander
Hi again,
I do not think this is feasible because Notepad (and other non-office programs) is not compatible with check in/check out etc. I tried to edit the “OpenControl” for txt-files, but all i got was error messages…
My best answer is to switch to “Explorer view” and do it from there.
Alexander
Hi Alexander:
Is it possible to add a clickable “button” or icon next to a date picker that would insert “Today’s Date” into the field box?
If this can be done on the NewForm and EditForm, that would be great. If this can be done on a DispForm or even in a list, that would be fantastic!
I hope you are well-
Charlie
Hi,
Here’s an example – it could be added some functionality for F=first, L=last. Let me know if that would be interesting.
Update: Code moved here:
Set datefield to first day of month, today’s date or last day of month
I wonder why you Would like to have this in DispForm and a list? – please explain.
Thank you for the mail you sent – I’m glad you enjoy this blog, and that you find the solutions useful. I will try to answer your other questions.
Alexander
Hi:
I tried this on an EditForm and NewForm. I can’t seem to get it to work. It’s in a CEWP below the form and pointed to my JQuery 1.3.2 library. I need guidance.
Thanks-
Charlie
Hi,
My fault – see comment in code above.
Alexander
Hi:
The “date picker clicker” works perfectly! Thank you-
Two things:
1.) I’m not sure what you meant when you wrote:
“…it could be added some functionality for F=first, L=last. Let me know if that would be interesting.”
2.) If it’s possible to have this JQuery work on a DispForm and a List View, the user can click once and be done.
Thanks-
Charlie Epes
One more question:
Can the Date Picker Clicker work on more than one date field?
Charlie
I have trouble understanding how you want to use this functionality in DispForm and a list view. Could you describe what you want to achieve with this? (it is possible, but i do not see the full picture).
Alexander
Hi Alexander:
I told a fellow SharePointer about your talent! Now I’m passing on her request.
“We have a custom list with a lot of fields. I need to divide it into sections and then easily show/hide those sections. I am going to try dividing the form into div tags and then use jQuery to display the sections in either
Tabs or an accordion (I’ll send you the email with the screenshots.)
I’m just curious if, in all your SharePoint travels on the web, have you already seen this done anywhere? I’ve seen it done for a navigation menu but not for sections of an editform.”
Thank you-
Rebecca Waild
You find the solution here.
Alexander
Hi:
Similar to the “Date Picker Clicker”, do you know if I could click a link and the users login name would fill a People Picker (person or group)?… on a newform or editform?
Charlie Epes
Hi,
You find the answer here:
Link to fill user login name in people picker.
Alexander
Hi:
I haave users who are updating several date fields all week long and they are being trained to access the SP LList on the day that the action is completed. By clicking on a date field in a DispForm or better yet, a List view, the mouse-clicks are reduced greatly. In this case, speed is of the essence.
Charlie Epes
I have an upcoming solution for editing directly in a list view. I have to do some more testing and tweaking before it is released, but within the week it should be ready in v1.0.
I have tested it with date columns and single line text for now. I may find a solution for editing more fields. For now it is designed for editing one “TD” at the time.
Alexander
That’s great Alexander! Can’t wait to see it
Charlie
The article answering your request is found here: Edit date, single line text, number or boolean columns directly in list view.
Regards
Alexander
I have a project staffing form with a Skills column that is a multichoice field. I’d like to be able to split the selected values into individual keyword (phrases) so that they can be passed into a hyperlink that creates a search query string, i.e, the selected skills are: project management, estimating, scheduling, and the desired search query should be SearchCenter/Pages/peopleresults.aspx?k=Skills: “project management” Skills “estimating” Skills:”Scheduling”
Hi Dean,
Where would you like this hyperlink to appear? DispForm.aspx or in the list view?
Alexander
Thanks for the great site.
Wondering what the easiest way is on a standard share point form to prompt the user with a confirm alert (Ok, Cancel) to control whether or not the form is submitted?
For example, when the user chooses Ok, they are then prompted to confirm if they are really sure they want to submit the form – if they choose Ok, then the form submits. If they choose cancel then nothing occurs and the user is able to continue editing data on the form (i.e. the form is not submitted)
Thanks
FT
Hi,
Add a CEWP below the list form in NewForm and EditForm. Insert this code:
SharePoint automatically executes any code in this function when pressing “OK”. It must return true for the save item to take place.
Alexander
Thanks Alexander – It worked perfectly!
FT
Hi Alexander:
A user asked me if it’s possible to have a button on a List View that, when clicked, would highlight the entire row. This way, the user would be able to flag items for specific review by another user.
I suppose it would be necessary to have it be a click-on/click-off feature. Possible?
Thanks for all your fine work.
Charlie Epes
Morning Alexander:
I ran into this code which is almost exactly what I was thinking about.
http://sharepointblog.spaces.live.com/blog/cns!74C8FB1191265567!526.entry?sa=917815030
I’m not sure if you started on this or not but this might be a good alternative.
Thanks-
Charlie Epes
Hi,
I thought about this request as an addition to the “EditInListView”, by using a yes/no-column to toggle this highlighting.
The issue with the one you link to is that it lives in the current page only – there is no write back. Therefore you cannot have on guy click on the line to toggle “follow up this item”, and another guy finding the highlighted rows.
It has to be a write back action to manage this.
Alexander
An addition to the EditInListView would be great! My company doesn’t allow webmail access so I can’t even get to the WindowsLive account again. Oh well, I rather go with your solution! I never considered the writeback issue….
Is it possible to broaden the EditInListView to “currency”?
Charlie Epes
Currency should not be a problem, i will update the code and let you know when it’s in place.
Alexander
Hi Alexander:
I was wondering if you had time to ponder the “yes/no-column to toggle this highlighting” that you said could possibly be added to the EditinListView.
Post: https://spjsblog.com/2009/11/05/requests/#comment-680
Thanks-
Charlie Epes
Hi,
Thank you for reminding me of that. Here it is:
Highlight row by value in Yes/No-column
Regards
Alexander
I’ve got a list with columns that indicate individual’s status on certain days of the week. I’ve created views for each day of the week that only show the columns that apply to that weekday. Now I want a webpart that uses javascript to determine the current day of the week, then displays the view for that day.
Almost forgot – thanks bunches! Your tip about how to edit a page that you’d hosed up with a faulty script just rescued my day! 🙂
Hi,
Here is a simple solution that reads the current day and redirects you to a view with that name:
Add it to a CEWP in your view’s.
If you add “?StopRedirect” to your url, you stop the redirect action (to let you edit the script without having to wait for the right day :-))
Regards
Alexander
Hi Alexander:
Thanks for the Tabs solution. I’ll try it this week.
I had another thought/request.
1.) Is it possible to wrap a List View of field headers and the data into two rows?
ListView Example (before):
Col1 Col2 Col3 Col4 Col5 Col6
data1 data2 data3 data4 data5 data6
ListView Example (after):
Col1 Col2 Col3
Col4 Col5 Col6
data1 data2 data3
data4 data5 data6
Thanks-
Charlie Epes
Hi Charlie,
Once again i must ask what you want to use this for… With one heading column, and one data column like you sketch, it will work. But if you add more rows in the form – how will users know which heading is for what field?
Alexander
Hi Alexander:
On several of my lists, I struggle with the width of the page and too many fields. I use some simple javascript to wrap the column headers but I still need to prevent users from having to scroll side to side.
My thought is that like-fields, such as date fields, could be clustered together, either on top of each other, or on a 2nd row.
For example, another .Net application I use (which is similar to yours “today’s date picker clicker”) the stages in a process are stacked in 2 columns. I will send you a screenshot via gmail.
Charlie Epes
Hi Charlie,
Not directly what you asked for, but this might work:
Show current row wrapped in a floating table when hovered.
Alexander
Hi Alexander:
Thanks for this. It’s not what I was thinking about but I’ll take it!
Charlie Epes
I really like your Tabs in SharePoint form you posted. Is there any chance that you might create a tab container that places webparts on the page into it? For maximum user could they be selected by webpart ID and not by the zone. This way more than one tab container could be placed anywhere are the page.
Hi,
Take a look at “Easy Tabs” from Christophe at PathToSharepoint.
No need to invent it again if his solution does what you want…
If this is not what you need, let me know and i will look at it.
Alexander
Christophe’s Easy Tabs is an excellent webpart but it grabs everything within a webpart zone. What would be nice is to allow the selection of which webparts are to be placed in the tabs from the webpart zone. This will give one more ability to have more than one “Eays Tab” type webpart within a webpart zone.
Another method for arranging webparts in tabs in a webpart page is found here.
Alexander
Hi Alexander,
I would like to use your headings solution but in the displayform have one of my other fields display as text after the heading so:
This is a heading – this is a field.
Would this be possible?
Thanks
Andrew
Hi,
I’m not sure what you mean – can you explain a bit further?
Alexander
Hi Alexander,
I mean when the headings appear in the dispform I would like one of the fields to appear alongside it. So a text field is displayed against the heading.
Thanks
Andrew
Hi,
Take a look at this two articles and see if you get some “inspiration”:
Modify formlabel in SharePoint form
Add individual label for each choice in multichoice list
Alexander
Hi Alexander
This is what I am after but I wanted it to be shown against a field used for your headings article but obvisouly this hides the field on the form and just shows what you have in the field for example:
#H#17#880077#Outcome
What I would like is an internal fields contents to be shown after the outcome text before in the DispForm.
Thanks
Andrew
Hi again,
Is what you want just to “fatten” up the existing field label for a singe field?
Alexander
Hi Alexander,
Sorry if I seem to be confusing you. What I have at the moment is a heading created by your headings article which is called ‘OUTCOME’. I then have another field called DESCRIPTION which text is entered in to.
In the Display Form I would like the contents of the DESCRIPTION field to show alongside the OUTCOME heading. For example it would look like the following in the form:
OUTCOME — contents of DESCRIPTION
next field
next field
next field
If you still do not understand then please let me know and I could provide you with screenshots.
Thanks
Andrew
Is this beginning to resemble what you are after?
Before
After
Script
Alexander
Hi Alexander
This is exactly what I am after, I will give it a go and see how I get on.
Many Thanks
Andrew
Hi Alexander,
I would like to ask you for help, regarding setting a people picker field to be read only on EditForm. There are 4-5 people picker fields and i have nicely implemented the script to hide the checkperson and browse buttons, it works great thanks, but now i need to make those fields Read Only and they are filled with values. I have already tried with a script to find elements and hide the people picker field by the title element but it works only for the first people picker field, not for the rest of the form. Any help is welcomed.
Thanks,
Esad
Hi,
I have answered a question like this in another post. See what you get out of it, and ask again if you do not get it right.
Alexander
It does the job, makes the field read only but it also swaps from display name to account name and am running from this issue.
Is there any way to make the people picker field read-only but also to retain the Display Name in that field instead the account name.
Hi,
Which browser do you use? In my setup it does what you want. If you send me the code by e-mail, i can look at it (not the fieldutility.js).
Alexander
Hi Alex, sorry for the late reply, holidays:)
I am using IE7, and i got it fixed somehow 🙂 Thanks a lot Alex, i drink my coffee and check your website almost every day.
I do have another question if it is appropriate to ask in this post, and it is regarding how can i check if attachments are present on NewForm, and if not to push an alert. I know the PreSaveAction function does simular job, but have no idea for attachments.
Thanks again,
Esad
Try this code:
Alexander
Works like a charm. Attachments in sharepoint item are a must have now thanks to you. Dunno why MS doesn’t include it as an option already.
Thanks Alex,
Esad
Hi Alexander,
I am not sure if you have recieved this request before, but it is related to this website, not a javascript request. I was wondering if a “Table of Contents” could be added in addition to the forward/backward choices at the top. Perhaps this already exists somewhere and i missed it. I love this site and look at it often, but i’d love to be able to go directly to an entry.
Thanks for all of your hard work (and generosity in sharing!)
Tasha
Hi,
I agree with you, it would be nice to have a complete TOC of all posts, but I have not found any plugin available in WordPress that provides this.
It would have to be a manual job making this list… I will look into it if i find time.
Regards
Alexander
Hi Alexander I am trying to perform the accordion with the Jquery UI. It works if I do it in a New, Edit, Display form. but when I try to create a single item form in SPD I am having no luck. Any assitance would be greatly appreciated.
Hi,
I answered your question in this post.
Regards
Alexander
Oh yeah by the way I was able to locate a wordpress plugin for TOC.
http://www.evanscode.com/wordpress-table-of-contents-plugin/.
Hi,
Thank you, but this is only for making a TOC in a single post, and not to “index” all posts in a blog.
Regards
Alexander
Hi Alexander,
if you are still looking for a site wide TOC this might help you
http://wordpress.org/extend/plugins/table-of-contents-creator/
regards
Chris
P.S. Still trying to get the “visible to” script to work.
Thank you Chris,
My problem here is that my blog is hosted at wordpress.com, and i cannot upload custom plugins… I might move the blog to my own server later on, and then it can be used.
Regarding the “visible to” – problem, just send me the code to look at, and i will try to help. You find the address in the “About” page.
Alexander
Hi Alexander
Is there a way to hide fields from showing on a form?
Thanks
Andrew
Hi,
I have done a post on Dynamic expand/collapse fields or array of fields.
In this code you will find the essentials for hiding a field or an array of fields.
Ask if it’s hard to “extract” what you need from the code, and i will point it out to you.
Alexander
Hi Alexander
I have used the code but can’t seem to figure out which are the vital bits of code I need as it seems to mess up my dynamic expand fields in my form. If you would point the code out that would be very useful.
Thanks
Andrew
Hi,
In this comment, in the code line 11 you find the line that hides the field.
You have to refer jquery and to include the function init_fields() to use this method.
Alexander
Thanks Alexander I will try and hide my other fields that I require.
Thanks
Andrew
Hi Alexander,
I am trying to put some jQuery script into an EditForm but when I add the CEWP, the page gets locked into ‘edit’ mode. The site in question has Publishing switched on, and I believe this is the problem. Have you come across this issue and, if so, do you know of a workaround?
Many thanks
Stuart
Hi,
Are you sure you haven’t forgot to remove the “toolpaneview=2” from the url?
If not i have not seen it before and have no real solution.
Alexander
Good day Alexander,
I believe I have a simple request. I have found that some of my user have disable scripts in IE. In a CEWP I added noscript tags and in the no script tags I put a message to enable scripts and added css to hide the form. either my css is incorrect or this cannot be done. My request is I need a noscript way to dynamically hide the list form until user enables their script. here is my css. maybe I have id’d the wrong list form webpart.
#MSOZoneCell_WebPartWPQ1 {
display:none;
}
I have tested this several ways, and this works on my machine, but for some reason there are users that when they access the page the scripts dont run but they still see the form. do you know of any reason why this might happen. My script library is local and all users and domains have access.
I think identified the issue but still no luck on fixing it. I found some users are on IE 6. I am not sure how to make the script work for IE 6. Any thoughts?
I have no experience using noscript tags, but is it the script or the css that does not work in IE6?
How does SharePoint act when browsed with scripts disabled? I would guess it did not work as expected?
Alexander
the no script tag allows you to provide text for users that have scipt disabled. When I disable the sciript in my browser it works. These other users have something else. I noticed they are using IE6, and had a different security setting, but I have not been able to identify what the different is because I do not have access to their machine. when i run IE6 it works perfectly, so I know it is not you script or how I implemented it. I also confirmed that their scripting setting were set to enabled which really throws me off. I have no clue what security setting disabled causes this.
Hi Alexander
Is it possible to be able to move the OK and Cancel button to the left hand side in the New, Edit and Display forms?
Thanks
Andrew
Also is it possible to be able to change the background colour of a field to a different colour?
Thanks
Andrew
Hi, This is the answer to the first question.
Add a CEWP below the NewForm, DispForm and EditForm and add this code:
Alexander
And this it the answer to th second question:
Add a CEWP below the NewForm, DispForm and EditForm and add this code:
Alexander
Hi Alexander
They both work great. Thanks for your help it’s very much appreciated.
Regards
Andrew
is there a way to view all whether permissions are inherent or not in a document library. a script that can convert a calculated field to view all at once so dont have to click each individual item
Hi,
I do not think so, as the permissions are checked when interacting with the element. If anyone has some information on this, please share it.
Alexander
Hi Alexander:
This may have covered elsewhere but do you know a way to hide a Total column’s “Sum=” prefix?
Thanks- Charlie Epes
Hi Alexander:
I figured it out using JS:
Charlie
Hi Charlie,
I tried this code in a SP2010 list, but it’s not working. My SP list is on a sitepage with a graph webpart. What can be wrong?
Thanks,
Jimmy
Hi again:
My next question: Do you know a way to capture the Total’s (ms-vb and/ or ms-vb2) and place them into a CEWP to create a simple KPI or data summary grid?
Thanks-
Charlie Epes
I have been unsuccessful trying to auto populate fields. using your script get user information wss, Is there a way to write the returned data to fields in sharepoint, either through a click event or on page load (page load perfered)? I have a survey for managers. I need their subs to submit the survey and then roll up the averages to each manager. I do not want the user to have to click their name and their managers name, it is suppose to be anonymous. I know wss does not have manager names in the user profile, maybe we can do a lookup on an external list. auto populate user name in a people picker field, this field does a lookup to external list and auto populate managers name in a second people picker. can this be done?
Auto popuplate user in people picker field?
auto populate other information for other fields from external list base on previous people picker?
Hi,
I believe this is related to this question.
Read the answers here.
In general, it could be done like this for a Text-field:
Alexander
Finally made it back to this one. Got it working, trying to implement on people picker. input.val not working. Can you provide the text to change on line 5 for setting a people picker val. I know you have the script with the click event. And using that script I could auto populate the field. I was hoping for a single line, set field val like above.
Hi,
Replace line 5 with this:
Alexander
I was so close. there is a small bug. In WSS when the form load, with the new script, the menu (top right) for my settings opens.
do you know what might trigger that.
I will set my bet on that the FieldInternalName is wrong. Check it again.
Alexander
I’m a dumd ass, damn it! cant believe after all this time reading through your posts I missed that again.
Hello Alex,
I’ve been trying to make a report out of a list but with multiple-filter choice fields that a user selects them and pushes it in the URL string. It works good only when you need two values, but if you want to add another value and then select only two out of the three… and i am stuck.
Any ideas how to make the list to be filtered via multiple options buttons.
I like the new post for the workflows, will implement it.
Regs,
Esad
Hi,
Is it a string like this you are building:
If so, you have to make a function to build the string so that you do not get “holes in the numbering sequence”.
If the user only selects the filter for “Model” and for “Color” the FilterField3 and FilterValue3 must shift to FilterField2 and FilterValue2.
Alexander
Yes alex you are right, working on to make it happen.
Regs,
Esad
[16.01.2010: Edited by Alexander to fix the codeview]
Maybe this time I can post something we can get to work. I have been trying to peice together several scripts, including yours to make the multiple line text fields expandable. I found a workiong script but it only worked on plain text. I am trying to modify it to work on rich text. When i add your script for fieldinternalname I can at least see the image under the rich text box, but it does not work. using the new script I can not get the plain text to work. this is the link to the jquery plugin for textarea resizer
http://plugins.jquery.com/project/TextAreaResizer
here is the script I am trying to modify
the image is just a bar at the bottom of the field.
Can we get this to work with internal name?
can we get this to work on rich text field?
sorry bout the code. I swear I placed the code blocks in.
Hi Larry,
There is no problem making the “Multiple lines of text – Plain text” expandable, but making the Rich text ones expandable proved to be more challenging…
It took me some time to figure it out because the Rich text multi lines are made up of iframe’s and does not like being messed with.
I have the solution mostly finished, but i will test it a bit more to eliminate a few possible bugs before posting it.
It will be ready during the next week.
Regards
Alexander
If anyone could do this, I know it would be you.
Here it is:
Add resize handle to multiline text field (plain text, rich text and enhanced rich text)
Alexander
Hi Alexander
Is it possible to hide the Attachments on the DispForm based on Group Membership?
Thanks
Andrew
Hi,
Yes it is quite simple.
Use the setup found here:
Showing or hiding list fields based on membership in a SharePoint group
But edit the CEWP code like this:
Alexander
Thanks Alexander, that works great.
Andrew
In addition to my previous request. I need to convert my view from horizontal to vertical. I think this should be easy enough. In my view I want to do an average. 12 questions with numeric responses. how can i get the averages vertical also.
currently we have by default
q1 q2 q3
score score score
What I need to do
q1 – score
q2 – score
q3 – score
…
is this possible?
Hi,
I had a similar request here, it is not actually what you ask for, but take a look.
Another approach could be the view style “Preview pane”.
Alexander
Almost, so close. All I really need are totals. I dont need individual row items. In fact I want to hide all row items and average my grouped scores. Can that be done in that preview pane, pull in multi rows and return a total or average?
Hi Alexander:
Do you know of a way to change the “tilt” of a field or column header in a List to verticval or diagonal?
T
h
a
n
k
s
Charlie Epes
Buffalo, NY
css is the easiest way
[sourcecode language="language="javascript"]
.ms-viewheadertr td, .ms-viewheadertr a {
writing-mode: tb-rl;
filter:fliph flipv ;
vertical-align:center;
/*text-align:center;
text-wrap:normal;
LAYOUT-FLOW: vertical-ideographic;
word-wrap:normal;
text-align:center;
writing-mode: tb-rl;
direction: ltr;
filter:flipv fliph;
white-space:normal;
white-space-collapse:collapse;
width:55px;*/
white-space:normal;
white-space-collapse:collapse;
/*color: black !important;*/
}
.ms-menuimagecell, #imnhdr0 {
display:none;
}
[/sourcecode[
the css is mostly for columns in list views, you just need to identify the style or IDs to apply the classes.
Here is one method:
Add this code to a CEWP below the list view.
Alexander
Use this for diagonal layout:
Alexander
Hi Alexander:
Thanks to both you and Larry for the vertical headers
Charlie
Hi there,
I just came across your site and wanted to say thanks for all the great articles. I don’t recall seeing an article referring to what I am looking for, so I thought that I would try to explain and see if there is a solution that you know of. I have a vendor contact form where enter the company, name, phone and a list of services that they provide (choice from a lookup column that allow multiple values). What I would like is to have is a view that would have each of the individual services listed and then list the vendors that provide that service. So a vendor might be displayed more than once if they provide multiple services. It would be similar what the yellow pages would display. For example the input would be
ACME Corp Electrical; Plumbing
Sunrise Co. Plumbing; Heating
Zap Enterprise Electrical
Output would then be
Electrical
ACME Corp
Zap Enterprise
Heating
Sunrise Co.
Plumbing
ACME Corp
Group by does not work with lookup or choice fields.
Any ideas would be greatly appreciated.
Thanks,
Scott
Hi,
I’m sorry, but i cannot think of a solution with a standard list view. It may be possible with an XSLT dataview (this is not my best area), or it could possibly be done with a custom made “list view” created with javascript and CAML-query.
You could then first query the “lookup source list” for all services, and then loop trough all services querying the list of vendors for which is providing the service – building HTML from the result.
I cannot give you anything more right now, but this may be looked at later on – very busy right now…
Regards
Alexander
Hi Alexander:
I am wondering if it’s possible to reorder the (.ms-gb2) 2nd “group by” field of a List view by ascending or descending “count” order, instead of Alpha (if it’s people).
ms-gb = month
ms-gb2 = person
Total is set to count items.
In my example, I would like to see the person with the most item “count” at the top and the others below him.
January
John (22)
Mary (19)
Alexander( 18)
Charlie (15)
Thanks-
Charlie Epes
Not sure if this got a response but I have resolved this by creating a calc column the add numerical value to month (01) January. That group by the calc. In my requirements I added year also because next year is different than last year.
Hi Alexander
Would it be possible to pop up a dialog box when a Yes/No field has been selected to Yes with a message and an ok button?
Regards
Andrew
Hi,
Like this:
Add to CEWP below NewForm or EditForm.
Alexander
Hello Alexander,
I have reorganized my form in 3 tabs schema and it´s working great, but at the second tab I have an specific concern:
I have 5 fields in the second tab but I would like to have the option to add a button below these fields that when I click this button would be possible to add 5 extra fields like the fields that I already have( I believe that they should have different names to not have a problem) and also an “x” or “remove” button to remove these 5 fields that I added there, like if I have created I new form clicking in a button, do you know what I mean?
My first idea was “ok I can do that integrating an ‘accordion’ in a tab”, so in each accordion part I´ll have the 5 fields. I tried to do that but I didn´t have sucess
I don´t know what can I do for solve that, is like if I already the fields in a hide situation and when I click in the button field they appear. I have a page in a intranet that has that and it´s a javascript solution that loads a jQuery library, could you help me with that?
Thanks
Hi,
I have not tried anything like this in a “tabbed form” and cannot be sure, but look at this post:
Dynamic expand/collapse fields or array of fields
or this one:
Dynamic expand/collapse fields or array of fields by multi select
and see if you can make something out of it.
The fields you want to add with the button have to be actual SharePoint fields, initially hidden.
Alexander
That helped me a lot 😉
I am using that, thanks Alexander
Hey a simple request
Is there a way to remove or hide the Ok/Cancel buttons only the ones from the top from a NewForm.aspx?
I wanna to keep the ok/cancel from the bottom and just remove or hide the ok/cancel from the top, is it possible do that without using Sharepoint Designer?
My main concern is that the ok/cancel buttos from top and from bottom has the same value and if you apply the code in one will reflect in another
Thank you very much
Renan
Like this:
Alexander
Thanks that solved this question 😉
Is there a way to create an anchor within a NewForm or EditForm? I have a long intake, or it could be long. When I assign the the item to an owner and provide them a link to the form, it would be easier to have an addition to the link with the anchor that links to a specific field in the form. Maybe a script that uses the fieldinternalname and converts that to the anchor name for simplicity.
Good Request Cookie:
I have often wanted to find a way to add “Bookmarks” to SP forms for that very reason… much like you can bookmark a Word Doc or PDF to specific regions of the page.
My need would require that I place links to each of the bookmarked form sections into a CEWP at the top of the form’s page so the user can skip right to the section he/she wants.
Charlie Epes
Look here for a possible approach:
SharePoint form: scroll to field as with an anchor tag
Alexander
I have been thinking about another possible request. I like your text to choice script pulling the items from a source list. is there a way to expand this so that the dispaly value is different than the return value? Like a standard select field you can have the display value something easy to read, but the value returned may be a number or a shorter version of the label. Maybe the source list has two columns, display column and a return value column. Almost like the yes/no field where that returns a number, but the user is selecting yes or no.
Hi Alexander
You are da man!! Thank you for the education, would there be a way in the new form of a list to populate the multiline text box with a default value, a html table etc….
Tony
Hi,
This code is for a list with three fields, one plain text multi line, one rich text multi line and one enhanced rich text multi line: FieldInternalNames: Plain, Rich and Enhanced. Adapt the reference to jQuery as needed:
Alexander
How would one adapt this to placing a default value in a hyperlink column and updating its description?
Thanks,
[moved by Alexander]
Sorry man added this to a CEWP and cant get it to work…..
The location is right because I have used it before, the internal name is from the source (I may of typed it wrong here)
Anything I am missing?
I call it using:
setMultilineFieldValue(‘Enhanced’,”Enhanced rich text”,true);
Besides the location of the library I changed the following
item.find(‘.ms-rtelong’).contents().find(‘Request_x0020_Description’).html(” + strVal + ”);
[moved by Alexander]
sorry context would be good the previous post refers to setting a default value to aehnaced multiline text box
I used your code as is just changing where i found the scripts and changed body to internal name of my field
Eliminated first 2 calls to function because we are only using enhanced and finally added this code to a cewp
Cant get it to work….UGH I am stupid ur a god, I am ugly ur good looking etc….
SORRY!!
Hi Tony,
Did you put the CEWP below the form? It has to be placed below for it to work.
Alexander
Hi tecrms,
The hyperlink field is nothing else than two input fields. Populate them like this:
Alexander
Alexander
While the text fields work correctly,
$(fields[‘MyHyperlinkField’]).find(‘input:first’).val(‘https://spjsblog.com’);
$(fields[‘MyHyperlinkField’]).find(‘input:last’).val(‘SharePoint JavaScripts’);
Crashes the page and I have to remove the CEWP. I then tried your basic script for filling in a text box with the following and it still crashed the page.
// autopopulate a field
fields = init_fields();
// Find the Title-field and insert text
// $(fields[‘Title’]).find(‘input’).val(“Insert this text in the Title-field”);
// Use the following to set HyperlinkFields
$(fields[‘MyHyperlinkField’]).find(‘input:first’).val(‘https://spjsblog.com’);
$(fields[‘MyHyperlinkField’]).find(‘input:last’).val(‘SharePoint JavaScripts’);
function init_fields(){
var res = {};
$(“td.ms-formbody”).each(function(){
if($(this).html().indexOf(‘FieldInternalName=”‘)<0) return;
var start = $(this).html().indexOf('FieldInternalName="')+19;
var stopp = $(this).html().indexOf('FieldType="')-7;
var nm = $(this).html().substring(start,stopp);
res[nm] = this.parentNode;
});
return res;
}
Any thoughts?
Thanks!
BTW MyHyperlinkField is the name of the Hyperlink field in my test list
Hi tecrms,
Some control questions:
Is it a unmodified form?
Is the CEWP placed below the form?
Does it work in another testlist?
Alexander
Some control questions:
Is it a unmodified form?
Yes, I started with a new library and only added the hyperlink column.
Is the CEWP placed below the form?
Yes
Does it work in another testlist?
Yes, It does work with a list form, but I am using a document library list form and that must be the problem.
I should have added what I am trying to do. I am trying to set a default link if one does Not exist.
Thanks for all your help!
Hi,
I have tested in a DocumentLibrary with this code:
The hyperlink Field is set.
Is there any other code that interferes?
Alexander
Your code is working now. The only difference I can see it the line >> if(typeof(fields)==’undefined’)fields = init_fields(); mad
The only problem I have now is:
if I update the hyperlink to some other path it resorts back to https://spjsblog.com
This code only updates if the field is empty:
Alexander
Alexander,
Thanks for all of your help! You Rock!
Hi Alexander
Sorry for the bother, would there be a way to have a cascade affect on dropdowns that are look up from other list
Tony
Have you seen this article:
Cascading dropdowns
Alexander
I am trying to create an accept terms script. I have a doc library and an Accept Terms list. When you enter the doc library I need the documents hidden and the list form for accept terms visible until user selects “yes” they accept the terms. 2 things need to happen. The accept terms intake is now hidden and the library is visible. I need the accept terms intake to have that electronic signature. Of cource if there is another way I am open to that. I also need to have the accept terms intake visible when the user has not accepted the terms. Something like I trigger a workflow to check back in six months and reset the field to force the user to accept the terms again. List form visible, doc library hidden.
Hi,
Interesting request. I will make a note of this one and try to come back with a solution. I cannot guarantee anything, but stay tuned and it may appear!
Regards
Alexander
I started working on this. I had my document library. I created a custom list with one field Choice Yes/No (required) and allowed content types so I could hide the title field. On the NewForm for accept terms I added CSS and Alexanders script to hide everything on the page but the one choice field and one set of ok, cancel buttons. I believe this would give an easy way to track initial accept. then your workflow can can run in the back to set your reminders.
In my document library I add a page viewer webpart, linking to my Accept terms NewForm. I am not 100% happy with this setup, but this is where my skills took me. Currently I ha a view with the doc lib at the bottom and accept term newform at the top.
I am working are trying to only show one of these at a time. default to NewForm until user accepts terms. May take me a little longer than Alexander, but it is a start.
Hi Alex,
I would like to ask you for help arround a big issue with keep session alive. I have appraisals done in sharepoint and the session timeouts on 10mins. To fix it i implemented a solution in an iframe “opening” a page on every 3 minutes, which in a way pings the server for a request. Now that works nice, except if the end user hits the save button in the same time as the script reloads/pings the server. Is there any way to implement anything to disable the save button before the page reloads and enable it after reloads.
I can’ enable bigger timeouts on the web app due to resources/RAM issue.
Regs,
Esad
You can disable the OK-button like this:
Alexander
Thank You, it works.
what is the line for disable a text field?
I tried this but not working
sorry for the bother, i got it:
[sourcecode]
$(fields[‘Title’]).find("input").attr(‘disabled’,true);
Yes I got it to work but I have a issue. I am populating the field with a query string value, I can see the value populated, but when I save the item, no value in the field. Have can i make the field read only, but have it save the populated value?
Sorry, set attribute to readOnly, not disabled. working now
Hi Alexander,
First off you rock! The Field side by side script was great.
I have a request. I have registration form and at the top it has an attendee section. I have it defaulting to the following three columns:
First Name
Last Name
Email
Is there a way to have a plus sign so that they can add additional attendees if needed.
Thanks in advance
He has 2 other scripts already post that may interest you
https://spjsblog.com/2009/09/10/dynamic-expandcollapse-fields-or-array-of-fields/
and
https://spjsblog.com/2009/11/28/dynamic-expandcollapse-fields-or-array-of-fields-by-multi-select/
Thanks , This is what I was looking for!
Wow, you get a lot of responses! Well, here´s one more. Have you tried to prefill a value in field control in a page layout? Or if you got an SharePointWebControls:RadioButtonChoiceField, that builds of a choice column, let say you have alternativs in the column and want to render the page with one of the alternatives. Another thing like this would to populate todays date in a datecontrol. Alexander, have you tried this?
Best from Christian
Hi Christian,
I’m not sure i understand what you are asking for. Please send me an illustration and i will try to answer. I do all my work on unmodified forms – i never change them in SPD, and therefor have little experience with xslt-dataview.
Look here: Set datefield to first day of month, today’s date or last day of month for some info on populate todays date in a datecontrol.
Alexander
Hi, thanks for your quick reply. First, if I have a content type that connect to a global column and this column is a choice (with checkboxes).
Then i use this in some page layout as a field control, and in SPD into the code among HTML (no dataview with xslt), the SharePointWebControls will be visible. This one I would like to modify like I can do with a SP list. I have try to modifiy this with Js with no luck yet, it seems to be different compared to ‘normal’ modifications with lists.
Drop me a mail if you like, I will send you some screencaptures that explains more exact.
Keep up your great work, thanks!
First, great site. I can use a lot of these tips on my current projects. Have you thought about using more categories in your posts so it would be easier to browse? Just an idea!
Do you have an ideas on how to remove “empty/blank” items when using the “group by” feature? See the example below. In other words, for category ‘Test 1’ you have to expand the blank item just to see the documents since they don’t have any subcategories assigned to them.
Example:
* Category: Test 1
* Subcategory 1:
– Document 1
– Document 2
* Category: Test 2
* Subcategory: SharePoint
– Document 3
– Document 4
* Subcategory: CRM
– Document 5
– Document 6
This is how I want it to work:
* Category: Test 1
– Document 1
– Document 2
* Category: Test 2
* Subcategory: SharePoint
– Document 3
– Document 4
etc.
Thanks!
Kale
Hi,
I have had many requests for easier overview of the posts… I will try to add some more categories.
Regarding your request it may be possible, but would require the script to “click” on the empty subcategory to load all the items, then remove the heading. I will add this to the “queue” and see if i can give you an example.
Regards
Alexander
Look here Expand empty subgroups and remove group header in grouped list view for a possible solution.
Alexander
Hi Alexander,
I’ve got a request about the possibilty to rollup events in a Gantt-view of a calendar.
The Gantt-slider (http://www.pathtosharepoint.com/Gantt/default.aspx) is a nice thing to have but all items are listed. I like to group the events by user name to show all planned holidays per user over the year.
Is there a way with javascript to be able to do that?
Thanks for your attention!
Regards,
Stefan
Hi,
I have not done any work on Gantt-views and cannot help you with this at the moment.
Alexander
Hi Alexander:
Is it possible for a Lookup field’s choices to show as Radio Buttons or Checkboxes on a form, instead of the usual drop-down?
Thanks-
Charlie
Hi Charlie,
It is possible for single lookups, but the lookup controls are rendered differently depending on the number of returned items (below or over 20 items). This is for single lookup’s and would work with radio buttons only.
The multi-lookup is another, more complicated issue.
I cannot help you on this right now, but might come back to it later.
Alexander
Boy you have your work cut out for you. Hope you are not getting overworked.
I am trying to figure out a way to count unique visits to a single page in a single day. Is there a way with jquery that can look at the UserProfile, identify the user on first visit, and tally all unique visits during the day?
On a grander scale, can the numbers or tallies be written to a list that tracks counts for multiple pages, by unique users?
Hi,
This would be possible. The “result” would have to be written to another list by a javascript-function.
Each page that is “counted” must be fitted with a CEWP with a script.
If i do this – would you prefer one line added to the “counter list” for every visit, or one line adding up all visits and presenting as a number in a column?
Alexander
Initially I was thinking that one line with count would be the best, but after thinking I believe it would be easier to just create a new line for each visit then can sort and group. This would also allow for other information like User, referring URL etc..
In my search I actually came across a SP WebPart that does almost exactly what I am trying to do. The major issue with this is it needs to be installed on the server and thats not happening here. The functionality seemed to be simple. Had a list with several columns. thatbe updated by alll groups and permission levels, including visitors and it displayed a counter on page.
http://hitcounter.codeplex.com/
Too bad this is not a web part I could install with a simple upload.
Hi Larry,
Sorry, but i had forgotten about this…
I will post the solution later tonight. It is actually quite easy!
Alexander
Hi Alex 🙂
Hopefully you will laugh at this one, I would like to add to the right of the field a verbage/icon that you can click on and get help not mouse over
As simple as opening a new page with info thats it….
For example click here for help and its opens a new window with explaination
Tony
this should take you about 90% of the way there:
https://spjsblog.com/2009/10/29/add-html-mouseover-tooltip/
Instead of writing text write a hyperlink to a popup. I have played with this script and have move the icon all around the cell, it is not difficult to figure it out. take a look and let me know.
sorry dude I am stupid i need all that to add a link to the right of the field that can be clicked on and opens a new window?
Hi Tony,
No, not stupid… Do it like this:
“Title” in line 5 is the FieldInternalName of he field to append the link to.
Alexander
Hi Alexander
How do you create the drop down toggle script to work if you have one drop down field that shows a field based on yes and no and another drop down that shows a number of fields depending on a numbers (1,2,3,4,etc)?
Thanks
Andrew
Answered here
Alexander
Have you written a script to create a slide show from an images library where you can control the order of the images? The default images library does not allow you to control the order of the images in the default slide show capability – it goes by creation date.
Have you checked out lytebox:
http://www.codeplex.com/lyteboxsp
also Christophe has a script here:
http://www.pathtosharepoint.com/Pages/ImageRotator.aspx
Hi Ben,
I have not done anything like this. Look at the links provided by Larry.
You may place another request if you do not find what you are looking for, and i will look at it if i find time.
Alexander
I see you are busy and I just keep adding. I will help out on your questions as much as I can. I have a New request. In a grouped view, if grouped by a people picker SP displays their account name. Can this be switched or swaped with their display name?
example by default:
DomainFLast
change to:
First M Last
Hi Larry,
Thank you for helping out in answering questions – nice job yesterday.
This has to do with the “information type” selected in the list settings for the people picker. You can change it there to “Name”.
Alexander
My problem is these Items are added by a workflow create new ilist item. The only way to ensure name to be written, I need the Account Name meaning I would continually need to switching them back an forth. Can we modify your script to access user profile and swap the account name with display name?
Hi, if we have one particular field in a list, and want to clean up empty spaces in that field, something like
field.value = (field.value).replace(/^s*|s*$/g,”);
do you have any ideas here?
Hi,
Is this a NewForm/EditForm? Single line of text?
Alexander
This code strips off all leading and trailing whitespace (uses the regEx you supplied):
Place in CEWP below NewForm or Edit Form (read here how to do that);
Updated: Missed “return true” in the function PreSaveAction()
Alexander
I want to edit this to force numberical valuse on a singleline textfield. reason is I dont want commas.
What is the expression?
instead of val().replace
if the expression != numbers
alert(“”);
else
ok to save
this should be fairly easy. I am going to search for the regex. and try to produce it. if you have any suggestions they are welcomed
Larry,
This regEx should do the trick (only numbers 0-9 is allowed):
myField.val().replace(/[^0-9]/g,”);
Alexander
that actually replaces the value with blanks, no alerts. If I want to set length = 9; and alert the user to make the changes I would need to compare. I cannot figure that out.
If not Num and not length = 9, alert user, no save
Hi, a single line of text and I think that would be good in both Newform and Editform, but most valuable for the Newform.
Thanks!
On the choice menu there is an option to allow user to Specify own value. is there a way to replace the text “Specify your own value:” and hide the field until the radio button for this is selected?
also on the reverse, when the option for Specify own value is selected, hide the original dropdown.
hiding the original DD may cause an issue. I think hiding the textbox until other is selected wold be a better functionality. remember specify other value is used for checkboves also.
Hi Alexander:
I need my users to click an “Add New” icon next to an item in a List View and have a NewForm pop-up with the same [Company Name] field already populated. Possible?
As always, Thanks-
Charlie Epes
This can be easily doone with a calculated field and Christophe script Text to HTML here:
http://blog.pathtosharepoint.com/2009/11/19/html-calculated-column-minor-update-and-some-advice/
if you need help writing the calculated field let me know I can help with that
There are also a few script, think I have one for the NewForw to populate a field from query string. We can wolk thru this step by step if you need the help
Hi Larry:
I’m very familiar with Christophe’s html calc field but how can I work it into this scenario?
I need to be able to grab a specific field from the first list.
Charlie
calc field:
=””
Now you have added a querystring value ClientVal. On the new form you can grab the ClientVal and add it to a field
sorry here is a sample calc field you could use
Hi Larry:
Ok I’m using Christophe’s solution for opening in a new window :
http://blog.pathtosharepoint.com/2008/09/01/how-to-open-hyperlinks-in-a-new-window-or-not/
The [URL] Formula I have is:
=CONCATENATE(““,Title,”“)
Do you know how to pass through the Title from one list to the NewForm?
Charlie
Hi,
If you use the method described by Larry, you can grab the querystring “ClientVal” from the url with parts of the script found here:
SharePoint form: scroll to field as with an anchor tag
Like this:
This code gets the parameter “ClientVal” from the queryString and inserts it in the “Title” field.
Alexander
Hi Alexander:
Coach me a little on this. I have my html calc column all set up like Christophe had. Where do I insert your script? a cewp on the List view or on the new form?
Charlie
One more questions:
My Title field is named “Company Name”. When I insert ClientVal=”&Company Name&”, I get “not support syntax.
When I insert “ClientVal=”&Title&”, it says it refers to a column that does not exist.
Do I have to insert the title field? Am I inserting the internalfieldname or the shown name?
Thanks-
Charlie Epes
Sorry. I put Company Name in as [Company Name] and it worked beautifully.
Thanks-
Hi Alexander:
I think this solution is worthy of a blog post!
Perhaps, “Open Duplicate-Title List Item in NewForm Window”.
Anyway, you and Larry helped me immensely today-
Charlie Epes
Hi Alexander (and Larry):
Small issue, but which ever image I use from the SP image gallery, the List View with the html column puts a heavy blue or mauve border around the image.
I know the color shows if I have previously clicked it, but is there a way to get rid of the border so the image appears as clean as the Edit icon?
Thanks-
Charlie Epes
Try this: add border=”0″ in your image tag
Thanks Larry. That works perfectly. I appreciate your help
Charlie
Hi Alexander:
Coach me a little on this. I have my html calc column all set up like Christophe had. Where do I insert your script? a cewp on the List view or on the new form?
Charlie
the script should be placed on the NewForm. this is where the query string is available, you will see in in the URL, Alexander’s script will grab it from there and write it to your field.
You guys are wonderful!!! This is tremendous…. Thank you –
Charlie Epes
Hi Alexander,
this has been by far the most informative resource I’ve read today and combined with Christophe’s site it’s a valuable addition to my favourites list.
I’m a sharepoint newbie but found myself somehow as one of two designing an internal site for our team. We thought about different opportunities to set up the site, though one thing was clear, we wanted to get rid of the typical explorer like folder structure and nesting.
Our idea sounded simple and logical, however today we learned that it might not work at all.
Instead of having multiple document libraries for different access levels we had the idea to incorporate a “visible to” column to define access by using metadata information.
The plan was to have e.g. team1 and team2 have read/write access to a doc library and each of them would only see documents tagged with the relevant visibility level. Turns out that we can’t restrict the visibility based on access level since there is no obvious way to match metadata against a group/role.
Since we only have site admin access our only help would be a cewp doing some sort of lookup of the user/group trying to access the doc library matching against the metadata column. The column can contain multiple values.
Do you think that it might be possible to solve this with some javascript code and point us into the right direction?
thanks
Chris
endusersharepoint.com had a neat script that allowed you to create folders with permissions based on views. Since they moved their site some of the items have not yyet been posted. I will try to find the original post. I think this can help you. Give me a day to find it.
I found the post. This may provide the permission level by views you are looking for
http://www.endusersharepoint.com/2009/01/14/automatically-switching-views-when-opening-a-sharepoint-folder/
Hi Chris,
I will write an article about this. I have had the same requirement myself, and have the scripts already made.
The method i used involved reading the “team name” from the user profile (the WSS profile or the MOSS SSP profile). You can also read the team name from a cookie.
I then take the team name and uses JavaScript to filter the view based on the value in the “Visible to”-column. This column must be visible in the view for filtering purposes, but the script can hide the column if desired.
By using another of my scripts, you can filter the list based on group membership.
This method have some limitations regarding grouped views. I will describe them in the coming article.
One other method for filtering a view is by using the URL-filter. This method is very god as it does not require the column to be in the view.
The disadvantage of the URL-filter is that the filter must be included in the link for it to be applied without refreshing the page.
I cannot promise a delivery date, but will try to get it done by the middle of next week.
Alexander
Larry, Alexander,
thanks a lot for picking up on this topic. On friday we tried a possible workaround using views but we weren’t able to restrict access to the other views nor the document library itself. WSS would always asign read to the document library if read was set to a specific view.
I’ll have a look at the eusp link and I’m definitely looking forward to reading your article, Alexander.
Again, thanks a lot for your help!
Chris
Larry,
I’ve read the description on eusp, but I can not find the script? Is there a trick to it? There’s only the “…add in the following script:”
And then an explanation on how the sript works, but no code?
Chris
I have this replicated some where and I posted a request for the script at EUSP. Sorry taking so long but give me some time to track it down.
Hi Chris,
Here is my attempt to answer your question: Filter list view based on membership in SharePoint group.
Alexander
EUSP updated their post, the script is available
http://www.endusersharepoint.com/2009/01/14/automatically-switching-views-when-opening-a-sharepoint-folder/
Larry, thanks again, will try that tomorrow!
Chris
Thanks Alexander, will try it in detail tomorrow. So far I had no luck in getting it to work, I’ve downloaded a copy of jquery 1.4.1, changed the path/version but nothing happened.
Is there a chance that this will work in doc libraries, too?
Chris
Hi,
haven’t been able to get this to work. I don’t even know if the jquery part works or not since I don’t know how to verify this. Is there something I can insert into the code that will give me an indication as to wether or not the script is actually called?
Chris
To test if jQuery is loaded, insert this in the code:
This should give a dialog with a three line function in it.
Alexander
Thank you for all of your help!! Quick question hopefully, you showed me how to open a new window for help, how could I place that next to the display name? Is it even possible?
$(fields[‘MyField’]).find(‘.ms-formbody’)
.append(“What information do you need to provide?“);
Tony
Like this:
$(fields[‘MyField’]).find(‘.ms-formlabel‘)…
Alexander
Hi Alexander!
I have a multi-line text field I want to allow users to update in a datasheet view. The problem is that they can’t add multiple lines of text while in datasheet mode. Any ideas on how I can give them this ability?
Thanks!
Amy
Hi,
You can edit multiple lines of text in datasheet – not enhanced rich text, but both plain text and rich text are editable. Is it the linefeed (Enter key) that is the problem?
If so, use Alt+Enter for linefeed – like in Excel.
Alexander
hi alexander
is there away to display html to the right of a multiline text box? not below but actually to the right?
Tony
Hi,
Is it in DispForm or EditForm? – or other location?
Alexander
newform
Like this:
Alexander
Hi Alex,
Does anyone know how to hide column display names on sharepoint forms?
Using Alexanders script here you go:
Usually I use this in combination with writing new labels.
Here I replaced line 5 from above with this:
Hi,
Just remember to refer the jQuery script as well.
Alexander
Hi Alexander, I did not succeded wiht the code that strips off all leading and trailing whitespace (and use the return true), have for example a complete new custom list with only a default Title field, and have the link to the latest min right, and have the CEWP below. Some idea?
Check that jQuery is loaded with this alert:
alert($);
It should give a dialog with a function.
Alexander
hi Alexander,
i accidently stumbled on your great blog search for a way to modify my lsitview with javascript.
here’s what i would like to accomplish:
i have this allitems view with multiple columns. One of these colums is of the multi lines of text.
When i start editing my items my multiline column cell strats growing in size due to a point that i can only see one item in my screen and need to scroll down to see other items in the list.
Is there a way to limit the number of characters in the multi line column (named “Voortgang en resultaat”) to show less characters: preferably one line of text or text up until some splitting character?
thanks,
ronajon
Hi,
I have made a solution that should fill your need: Multi line text field in list view: Shorten text and add hovereffect to view full text
Alexander
Hi, thanks again for all nice posts here, always intresting stuff here!
I try to figure out how to change the output text for the standard buttons in a newform.aspx, i want to change OK to Save for example. Have tried the ‘replaceWith’, but I don´t know how to get the text when it´s a value? Any ideas here?
/C
Hi Christian,
Refer jQuery and do it like this:
Alexander
is there away to vote up or down a request, for example a list with a thumbs up or down next to each item that u can vote for once
Tont
Hi, works perfekt, and I noticed that SaveItem was the absolute last part of the ID for the button, as I can see in IE dev toolbar, like GoBack was the name for the Cancel button. Smooth. Thanx Alexander!
choice – Multiple select, check boxes, is there a way to have multiple default values. I may want the same 3 items to always be selected. by default SP only allows one option. This field for 90% may need those 3 requests. Can it be done?
Like this: Multiple default values in a column of type “Checkboxes”
Alexander
that was great
Are you passing on that accept terms request? I went back to review it and can’t find it.
You have to click “« Older Comments” at the bottom of the page. The article is in the queue, but there is not enough time…
Alexander
Hi Alexander great job by the way
How can we implement the thumbs up or down functionality you have on your site to a sharepoint list?
Tony
Hi Alexander & Larry:
I was hoping that I could use borrow some advice & suggestions from both of you on the setup and output of a SharePoint List.
I have Alexander’s email, but Larry I am wondering if I might email you too. My email is charlie dot epes at fnrm dot com.
Thanks-
Charlie Epes
Buffalo, NY
If its in general interest you may put it here, otherwise email me.
Alexander
I know you had a post related to people picker fields and populating other people picker fields from an external list. I want to tweak this.
3 single line text, first field (uses your script text to choice) to get value in external list, field2 and field3 auto populate. I just cant get this script converted. How can this script be changed to text fields, first field is text to choice. is is a quick change?
Is what you want to insert the returned value in a text field rather than a people picker?
Alexander
Yes text field. What I can’t figure out is what to change so when choice field1 or text to choice field1 on select populated fields 2 and 3.
Hi Alexander:
Further to your Multiple Choice Checkbox solution, do you know of a way to add a “Select All” to all checkboxes on an entire form?
Thanks-
Charlie Epes
I will take this one. I am documenting it now. Will ppost it here when done, if Alexander wants to move it that will be ok.
Larry
In your choice field (checkboxes) add a value “Select All”
add CEWP with this script
just update to reference to jquery. I have been able to run this with the code above and below the NewForm, EditForm. This probably could be tweaked a little cleaner, but it works very smooth.
If anyone is interested, when dealing with Forms library there is a repair or relink action. again depending on the amount of documents could be many boxes to check. I have adapted a script to add a select all on that page also.
You find a possible solution here: Add “Invert”, “Check all” and “Uncheck all” to a multichoice checkbox column or the entire form
Alexander
I have been trying to setup a blog. How do you get the script to display the way it does? is it a plugin? is it privately hosted?
This is standard functionality at wordpress.com.
Alexander
Thanks,
it must be me because I cant figure it out.
Hi Alexander great job by the way
How can we implement the thumbs up or down functionality you have on your site to a sharepoint list?
Tony
Hi,
I will take a look at this when i find the time. I think it would be possible either by writing the rating to the item itself, or by writing to another list.
I unfortunately have little time to spare, so i cannot promise anything, but i have added this to the queue.
Alexander
Here is a possible solution: Ratings for SharePoint lists
Alexander
Hi there hope you can help!
I need to get working – highlighting a row in SharePoint when the mouse hovers over it and when clicked on, selects the row entry displaying the dispform.aspx page.
I have achieved this through Sharepoint Designer but really need it to work on a normal SharePoint list.
Christophe got the highlight to work I noticed but I really need the dispform.aspx page displayed when clicked on anywhere along the row.
Again – hope you can help!
Take a look at these articles and see if that helps you on the way:
Highlight row by value in Yes/No-column
Preview metadata in list view on mouseover
Alexander
I am trying to disable OK button if choice equals “No” and enable if Choice equals “Yes” (not Yes/no choice, Radiobutton choice). here is the code I have. I took it from part of your dynamic hide show multiple select. Can you tell what I am missing?
Sorry again, I figure it out. anyone interested I will post the solution.
Thanks Larry great post
Larry I would like to see the solution
Disable Choice option until Yes is selected:
Here you go:
Not disable choice, disable OK until choice option is Yes
forgot the most important part
thanks Larry Great Post!
Hi Alexander,
I trying to create a search field to search a document library. Any suggestions?
Here is a great post for a library list filter. Peter Allen is as amazing as Alexnder. http://www.bitsofsharepoint.com/BlogPoint/Lists/Posts/Post.aspx?ID=54 if you dont like this I have a script, cant remember where I got it. It creates a text field at top of each column, type in any field and it filters also.
thanks Larry I will give this a try but if you come across your script I would like to see it. your script is exactly what I would need.
The only thing I was not able to figure out was how to remove the google fnction and replace with direct link to jquery
Thanks Larry This works great!
Hi,
I only wanted to link back to the author of this script: Jaap Vossers’ SharePoint Blog
Alexander
Thanks Alexander, I thought that was on another blog and it was bugging me not remembering
Hi there! I need a script or any solution in SharePoint to just display a note/comments. Is there perhaps a script that can hide the response field on a form so I could just display the column title with the note/comments?
Hi,
You could use this solution: Headings for SharePoint forms – another method
Alexander
Hi Alexander! Another challenge for you, i´m searching a way to make a document library automatically name the new folders created sequentially, i mean, the first folder´s name would be 001, the second one 002,… Do you think that could be solve using script?
I hope you can help me! thank you very much! 🙂
Sorry, i can’t help you with that one.
Alexander
I have list view. On above I want to give 3 control i.e. StartDate (Datefield), Enddate(Datefield), Checkboxes (Choice field) and a button i.e. “Search”. I tried with SPD, but not happy.
First I want to validate that Start date shounot be >= Enddate after selection, user will select checkbox value (can be more then 1)
Then user will click on Search button thne records will filter depending on selected criteria and display in view.
Please advise
A far as i know you cannot filter a standard SharePoint list view based on on a date range. At the moment i cannot provide you with any solution, sorry.
Alexander
I have 1 transaction List which has various fields, out of them 2 fields i.e. Name and Type (choice field) I want to generate a cross tab report. Where Name display vertically and type display horizontally.
Please help me out, I am not sure how to do it
Name1 Choice1 – Choice 3 Choice 4 –
Name2 – – – Choice 4 –
Name3 – Choice2 Choice 3 – Choice 5
Name4 Choice1 – Choice 3 – Choice 5
Hello Sir
Can you please help me to implement this?
Avi
can you provide a screen shot of what you are trying to achieve. I believe I think I understand. Looking at what the text displays its a bit difficult. is Choice1, Choice2.. fields or options of a field? I believe this could ne accomplished with a calculated field.
Lary
Choice1, Choice2, Choice3.. fields are a values of a “Work Type” field, its field type is ‘Choice’ it is displaying as Checkboxes with multiple selections.
If we discuss about functional logic i.e. Which Contact(Name field) is eligible for which work type, which we have normally set during new record creation.
Let me know if you need more information.
is this something like what you are looking for:
http://home.comcast.net/~larry.h.pfaff/output.png
You are great man, that is what I am looking for.
I’ll post solution tomorrow
Thanks
I spent a good poprtion of the day trying to work this out. I came very close. the problem I was having is with the multiple select. I am having problems reaading part of the string. If it was only for single select we would be done. With the use of calculated fields, HTML and Christophes script HTMLcc we could create a proof of concept. I will contine to tinker. Maybe Alexander will come up with something.
Today is a new day and I actually made some progress. this is my results today
http://home.comcast.net/~larry.h.pfaff/optionChoice.png
almost there
Okay I have finally achieved proof of concept. I started out with the two fields you had
– Name
– WorkType
Set WorkType to single line field
Created a calculated field “calc”
set it equal to WorkType.
Now WorkType must be deleted, then recreated as your choice, multiple select field. this is the only way calc returns the values in WorkType as a string. calc wont read WorkType unless you trick SharePoint.
The next set of fields depends on the number of options you have. I did it with 5 options so i created 5 calculated fields
opt1 =IF(FIND(“Choice 1″,calc),”Choice 1″,””)
opt2 =IF(FIND(“Choice 2″,calc),”Choice 2″,””)
opt3 =IF(FIND(“Choice 3″,calc),”Choice 3″,””)
opt4 =IF(FIND(“Choice 4″,calc),”Choice 4″,””)
opt5 =IF(FIND(“Choice 5″,calc),”Choice 5″,””)
The formulas are searching the string for that value. When you setup yours Choice 1 would be your option 1, same thing for the returned value if true.
As it is it returns the values in each column as iut should , but the find formula returns #VALUE! it the formual is false. I looked at a script and placed it on the page to do a string replace.
In a CEWP under the list view add this script
it is not jquery, but if someone wants to convert it I would be okay.
let me know if you have any questions
Larry
Thanks for this. I appreciate this and agree that without calculated fields it is not possible. That means need to create 5 calculaeded fields thne why do I need implement yout script.
I can create simple view with following fields Iwith yes/no option) and it will display horizontally.
Name
Option 1
Option 2
Option 3
Option 4
Option 5
What do you think?
Hi Avi,
Is the result Larry presented what you want?
To take the selected options from a multi choice and insert them in separate columns. You would then have one “Plain text field” for every available option in the multi choice?
What is the end result you want? – to filter and sort by the values?
It is a bit unclear to me actually what you want to achieve – that you do not already have in a standard list view.
If you provide an illustration of what end result you imagine, i might be able to help.
Alexander
Avi,
You right about why not just create 5 yes/no fields. Thats not what you asked for. So I worked this a little more and the solution I came up with works with 2 calculated fields now and your options are in a table format.
I was able to figure out the calc formula that did not return the #VALUE! on error.
you still need to start out the same way. set WorkType to Single line text.
Create field “calc” = [WorkType]
change WorkType back to choice multiple select
Create a calc field with this formula
for this code to work and display a table you will need the script text to HTML from christopthe site here:
http://www.pathtosharepoint.com/HTMLcc/default.aspx
Lary
Thanks, this is what I am looking for.
How can I used in new custom page? I have added CEWP, but how do I pass the list reference with this code?
Again thanks a lot.
Avi
passing the list reference is different then populating a calculated field. if you create this function in a list, then anywhere you display this list, the calc fields will also populate. this layout is for the output on your list views, or the dispform.aspx page, to convert the HTML to display, this will be placed into a CEWP below the list or below the list form. follow the link for the scipt and there are instructions on how implement
Hello
I have tasks list where we are assigning task to different staff persons on different dates. For assigning we are not using using people / group field type, we are using a calculated text field (First Name + ” ” + Last Name).
I want to display weekly calendar with next/previous navigation and schedule of each staff link as shown below
Initially it will display the weekly calendar with staff name under each
day column, but once user click any staff link name from the left menu weekly calendar then selected staff task will display in the weekly calendar
Is this possible?
——————————————————————-
Staff | Week of <<>
| Mon Tue Wed Thu Fri
| —– —- —– —- —
… | —– —- —– —- —
| —– —- —– —- —
| —– —- —– —- —
Calendar Look Like
————————————————–
Next Week Previous
————————————————–
Staff Mon Tue Wed Thu Fri
Staff1 — — — — —
Staff2 — — — — —
Staff3 — — — — —
…
…
Sorry, but i do not think i can help you with this one at the moment. I have done very little modifications on a calendar view.
Alexander
Hi Alexander:
One of my wishes is to be able to print Lists to paper and be able to set the column names and perhaps the banner of a List view as repeating page headers on the printout.
I imagine that JQuery cannot control a printout but perhaps it can divide a list view into selectable lengths with the column names so the printing it would mimic an Excel prinout with headers.
Footers on each page would be great too!
Charlie Epes
Have you seen the jquery plugin at eusp
http://www.endusersharepoint.com/2009/04/06/jquery-for-everyone-print-any-web-parts-plugin/
Hello
How can I add more menu option in list toolbar alongwith url reference and image?
Thanks
You may want to check out Jan’s blog. He has done some great work with menus
http://weblogs.asp.net/jan/
I’m not quite sure where you want this menu, and what is it supposed to contain? – static elements or dynamic elements?
Alexander
Hi Alex thank you for all your great work, you showed me how to add a help link after a rich text box, is there away to add it right after its title/name? For example filed name is description and have it appear like:
Description (Click here for help) and then the field…….
Tony
https://spjsblog.com/2009/10/29/add-html-mouseover-tooltip/
He also had a simple title tool tip, I am sure the text could be converted. or can try this
this is Alexander,s script
sorry adding to the last request i am using your code and have it as a single column, hope that doesn’t make a difference
Hi,
Wondering if anyone has figured out a way to create a cascading dropdown where the child dropdown is a Person/Group type field… e.g. Team and Team Member.
Any guidance is appreciated.
Travis
Where would you pull this information from? – a separate list as in my Cascading dropdowns script?
Alexander
Hi Alexander,
Yes, that was my thought… to have a separate list as most cascading lookups I’ve seen implemented… so:
Cascade Reference List Columns:
Team Name (Text, Dropdown, or Lookup column type)
Team Member (Person column type)
Make sense? Any idea how to accomplish something like this?
Thanks,
Travis
The cascading dropdowns script i have made can have a person (from a people picker field) on the last dropdown.
This script relays on single line text fields rendered as dropdowns, and cannot insert the “picked person” in a “picker field”.
Alexander
Hi Alexander:
Similar to your “Today Date Picker Clicker”, I am wondering if you know of a way to click yes/no in a list view.
I have a list with 31 choice fields with options of Yes and No (NOT a Yes/No check box). I would like a user to be able to click yes or no on the list view “cell” beneath the field. Clicking once would mean Yes, clicking again would leave it blank or No.
I know your today date picker was placed on a newform/editform. Is this possible on a list view?
Thanks-
Charlie Epes
Scratch that… I would be happy with the Yes/No check box field type being clickable on the list view, so it’s either on or off.
Thanks-
You have this script: Edit date, single line text, number or boolean columns directly in list view. It cannot be used in a choice field, but for a Yes/No-field it should do the trick.
Alexander
Of course. Thank you –
Howdy,
How would I go about a simple tool tip for a ordinary list. I can only use Java Script within a CEWP. I am trying to notify the user that when then hover over any item of the list that “Click to Filter”…I am using connected lists that filter and provide data to each other.
do you want a tool tip for a single cellin a row, or for the whole row?
For a single cell this can be done with a calculated field and a hyper link like this.
[sourcecode]
="<DIV><a href=’#’><img src=’help.gif’ title=’tool tip here’></a></DIV>"
to make this work your need a script from Christophe at pathtosharepoint.com here:
http://www.pathtosharepoint.com/HTMLcc/default.aspx
If you a more dynamic tooltip, I found this one to be pretty good and can be implemented into the calc field formula above
http://www.walterzorn.com/tooltip/tooltip_e.htm
Hi,
To add a plain text mouse over tooltip to the entire row, add this code to a CEWP below the webpart. You will have to identify the id of the WP you want to add this tooltip to, and replace “WebPartWPQ3” in the code.
Use IE Dev Toolbar, or FireBug for FireFox to inspect the code.
Alexander
Hi Alexander:
Another “is it possible?” question…
Is it possible to have a specific column’s filter choice appear in a CEWP that I would place above a list view?
Example: Filter the page by [Customer]
CWEP: would contain text + [Customer]
Thanks-
Charlie Epes
Like this: Show active list filter above list view
Alexander
I also have same type of question but slight different.
I want to filter my list by 3 inputs i.e. Start Date/End Date and Checkbox field.
I will ask user to select start date/end date (with validation of start date should not >= end date) and a 3 checkbox (leavetype) i.e. casual, holiday, medical and a go button
In the list I have requesdate and a choice field of leavetype (which allows user to select multiple value)
Now once user enter start date, end date and select 1 or multiple chackbox, my list should populate.
Is this possible?
Hi,
This one answered in another comment above, and i have to disappoint you:
Alexander
Howdy!
Hi Alexander, how are you doing? I haven’t seen any posts related to this, but please correct me if I’m wrong…
Is there a way to change the background color of specific fields in a list view using jQuery? I’ll give you a sight of what I need:
There is a table with the weeks of each month… side by side.. and the users must select a range of weeks that they’ll use for vacation. The fact is, my manager asked me to have the filled fields with a background color (blue for approved vacations and red for rejected ones). I hope I could get you the Idea. Well, thank you very much for the attention =)
Victor
Hi,
Take a look at this one: Highlight row by value in Yes/No-column.
Let me know if you can use this approach.
Alexander
Hello
I have two choice fields, 1 drop down and another is multiple radio buttons (6 values/radio button). This I want to implement on newform/editform
In dropdown I have 3 values i.e. Yes/No/Not Sure (selected by default).
I want to show/hide some of the radio buttons out of 6 radio buttons depending on condiion.
Let say
if user select “Yes”, then show radiobutton1 and radiobutton 3
If user select “No” , then show radiobutton2 and radiobutton 5
If user select “Not Sure” thne show all the radio buttons
How can I do this?
Hi,
I have written up a solution and will post it later today, or during the weekend.
Alexander
Here it is: Filter Radio Buttons or Checkboxes based on selection in another field
Alexander
new request for you. Character/word counter for multiple line field to display below the field. Not general for all multiple lines, but setup in a way that can set fieldinternalnames in am arr. also can we add a character limit, so user can not enterany more text.
I have several character counters. cant get it on the form. I am also looking into adding it on the create field page. calculated fields can only accept about 1000 characters. would like a way to display the count on that page.
Like this: Add character or word count to SharePoint multi line plain text field and restrict input length
Alexander
Hi Alexander
I have a drop down field in a sharepoint list which is populated with long selections. When the NewForm and EditForms are viewed on screen they require scrolling right to view them. Is there a way on the form of showing a number of characters with the … after?
Thanks
Andrew
Add this code to a CEWP below the NewForm or EditForm. The FieldInternalName of the select in the example is “MySelect”, you must change this to match your field.
On mouse-over on the truncated text, you get the full text.
Alexander
Is there a way to capture the IP address of the computer when a user is submitting an item in a sharepoint list?
Not with client side javascript. You must use server side code. I do not have any examples of such code, sorry.
Alexander
In a Custom Workflow users edit their Tasks associated with this workflow.
In these Tasks there is an option for them to enter a comment in a Comments field.
Is there a way to show this Comments field on the WrkStat.aspx page?
Also, is there a way to highlight the Outcome field if it is set to Approved or Rejected?
e.g. green if approved or red if rejected.
Hi,
A modification on this page must be done on the server. This page is shared between all web applications running on the server. I cannot help you with this one, sorry.
Alexander
eru, I’ve played with this before, and you can build a dynamic string (comments) and write it to the workflow history log. You may have to play with formatting.
I know this topic has come up before and I have pointed users toward other posts. Hos to do with filtering a list. there is a pretty good script out there that applies text boxes to each column and it filter on entered text. Today I was looking in to changing the textfields into dropdowns. Then i came across this webpart that creates a form at the top of the list and it has a date span filter. very kool. Even if the date span can be achieved thru jquery. is there a way to create a form that pulls data from multiple columns in a list and then can filter on select? What I think is a key featuer is the multiple select filter and right above the list.
http://www.kwizcom.com/ProductPage.asp?ProductID=404
It is possible to do some of this with javascript, but I’m kind of overloaded and cannot help right now. I may come back to this.
Alexander
Yes back with list filters requests. Is there a way that a user can hide columns of choice? Just like the script in my last request post that displays text fields maybe display check boxes. When the box is selected the column is hidden leaving only the checkbox. Unchecking shows the column.
With the above list filter script I found when user filters you can’t export that filtered view. The export exports all the data. Is there a way to have the dynamics filter and it retains the filert view on export?
Hiding columns is possible, but as i stated above, I do not have the time to do it right now. I might come back to it later on.
The export issue is not possible to overcome i think.
Alexander
I am sure you are busy. No worries I know if you have the time you’ll knock it out. I have been slammed myself, please don’t give it a second thought.
thanks for all your efforts
Awesome Blog! I’ve never seen such a collection of useful enhancements!
I am having trouble converting my Excel powerusers to Sharepoint due to certain limitations. I hope you find some of these interesting:
List View Issues:
* Freeze Panes – ability to freeze the first column and/or the top row in a List View (I’ve seen solutions for top row, but not first column, or both)
* Column Heading Tooltips – something like adding “comments” to cells in Excel. Could come from the field Description? Would display onmouseover.
* Count/Sum/Average Calculated Columns – I’ve seen a solution for one column, but not multiple
* Draw Column Lines – draw a line on the left or right edge of a column to have visual separation between blocks of columns
* Color Column Headings – color column headings to provide visual separation / grouping of columns
* Third Level Grouping / Sorting – (or more)
New/Disp Form Issues:
* Field Coloring – color field labels to provide visual separation / grouping of fields (in conjuction with above Color Column Headings)
* Horizontal Separators – a line or other visual way to separate / group blocks of fields
Frozen headers:
http://kjellsj.blogspot.com/2009/06/sharepoint-jquery-scrolling-view-with.html
Column attributes:http://kjellsj.blogspot.com/2009/06/sharepoint-jquery-setting-td-column.html
You could easily modify this code like this to fit your needs
Take a look here for color coded separators between sections in a view: Headings in list views. It is a bit outdated, but it works.
Read about headings in a SharePoint form (NewForm, DispForm or EditForm) here
I will make a note of your requests, and try to post solutions to some of them. I’m a bit busy at the moment and cannot promise a “delivery date”.
Alexander
Sorry, I hope its not greedy to post multiple requests. This one is not related to Excel deficiencies.
I need the ability to generate an html email, formatted just like the ootb alert email, by clicking a link or button contained in a List item column. The email would open in my email client (like Outlook). The TO: field would be empty but the Subject would contain the text of the List Item Title column. Here is the use case:
I have a List that contains change request items. I need to “forward” a single item to a resource on my team and include comments like “hey, why is this taking so long”, or “please log in and approve this request”. I want the email I send to appear like the structured alert emails that Sharepoint already sends so that its very familiar to the user, has all the same “View Item” and “View List” links at the top, etc.
A Calculated Field could generate a mailto link using this script HTMLcc you could get the functionality you are looking for. A simple formula like this should get you going.
http://www.pathtosharepoint.com/HTMLcc/default.aspx
I have made a note on this, and will write an article, but again: I’m very busy so it may take a week or two.
Alexander
So sorry. I forgot one key Excel feature that is missing in Sharepoint Lists. My users need the ability to do Excel functions similar to MATCH or VLOOKUP in Sharepoint. So the (somewhat confusing) use case would be:
List1 contains change request items. List2 contains release information including the Deployment Date. In List1 I have a Lookup to the Release Number field in List2. I need to be able to select the Release Number in the Lookup field drop down, but retrieve the Deployment Date instead for inclusion in List1.
The catch is that this association needs to be dynamic. So if I change the Deployment Date in List2, it changes in List1 as well (like Excel).
This is actually what I’m working on right now. It will hopefully be posted this week.
In your example it would be possible to make a calculated column in “List2” with a code like this:
And use this field as source for the Lookup in “List1”.
Alexander
Hi Alexander:
Is it possible to force every hyperlink in EVERY CEWP on a page to open in a new window?
Thanks-
Charlie Epes
I am sure with script you can limit it to specific CEWP. For a standard open in new win
Hi Larry:
Do I wrap this in JQuery or Javascript?
Thanks-
Hi
This code handles all external links in “ms-bodyareacell”:
Alexander
Hi Alexander:
Thanks for the code. I can’t seem to get it to work. I’m replacing my JQ url, and I’m placing this inside a CEWP at the bottom of the page. What might I be doing wrong?
Charlie Epes
My fault… Thank you very much. This is a huge help!!
Charlie Epes
Yea, I have a big page of links and I would love to have it automatically open in a new window instead of asking/pushing the user/admin of the site to add the code each time.
Thanks-
then you can try this, but will still requre it to ne inplemented on each page.
Get your weppart ID and update it below
I have a button and a textArea field on a SharePoint page. When I click the button I want it to insert Today’s date into the textArea field. (NOTE: the name/ID of the textArea field could be anything because the user will add this to a SharePoint list).
I have made the button appear on the Enhanced Rich Text Editor toolbar that appears on comments fields that are of type ERTE – Enhance Rich Text.
I know how to generate the date but I am having trouble identifying the field on the SharePoint page so that I can set the value of it to the date. I also know how to identify the textArea field if the name is constant but when it is added by the user the field name is random.
Do you know how to do this?
scroll 1/3 the way down A responed to a request with a script to setMultilineFieldValue that help get you started
https://spjsblog.com/2009/11/05/requests/comment-page-3/#comments
Thanks for replying Larry. The function init_fields in the script fails at the “ms-formbody”. I put the function into my .js file that is loaded by the master page of the SharePoint site. Other .js functions in this work fine so I think it is loading correctly. But when I call this line: if (typeof (fields) == ‘undefined’) fields = init_fields(); it fails in the init_fields() function.
function init_fields() {
var res = {};
$(“td.ms-formbody”).each(function() {
if ($(this).html().indexOf(‘FieldInternalName=”‘) < 0) return;
var start = $(this).html().indexOf('FieldInternalName="') + 19;
var stopp = $(this).html().indexOf('FieldType="') – 7;
var nm = $(this).html().substring(start, stopp);
res[nm] = this.parentNode;
});
return res;
}
Is this a custom list form (Customized form), or a OOB custom list ?
Is there am easy way to hide some items in the View menu. The problem I am have is every one feels they need a specific view, So i can create a webpart part the displays these in tabs. In the mean time I have a list of views a mile long, not very user friendly. Maybe even hide the view selector until I can figure a better way to navigate the important views
sorry, I found this post. give me some time to review
https://spjsblog.com/2009/11/27/hide-menu-items-in-list-view-toolbar-and-views-in-view-selector/
How can I hide “Download a copy” option?
Alex
Is this possible?
I have not had the time to look at this one yet.
Alexander
How can I prevent a dropdown box with more than 20 items from becoming a “filtered” drop down box? Right now my users have to double click a selection for my code to fire (which unhides/hides fields based on the selection)
A lot of users are not double clicking, thus fields are not getting filled out because they are not viewable.
I guess you are talking about a lookup column?
Take a look at this script Convert Singleline textfield to filtered lookup dropdown
This script can be used to convert a single line text field to a dropdown, pulling information from another list.
Alexander
Is it possibly to dynamically make a field required? If I’ve got a field hidden and I unhide it based on a selection, is it possible to at that point then make it required so they have to fill it out and prevent them from saving until it has some type of value?
Yes,
I have mentioned this in some comments, but not written an articles about it. You find some scrips for handling this in this collection from Erucy.
Se fieldutility.js
Alexander
Using WSS 3.0
Not have been able to find it anywhere so, since it is possible to filter a list items (in all event/task/etc view) based on membership in SharePoint group (By Alexander). I would like to request the possibility to filter an Agenda View on a single line text, based on a field of the current user information field (for instance department). I import data into SharePoint list what contains names of people. So users do not create the list items and there are multiple columns with names like Judge1 Judge2 Lawyer etc. As you all know you can’t use [ME] value in a single line text. This can only be used with columns: Created by, Modified by, Assigned to and People picking data. Problem with agenda view is also that it only displays 1 field (in general description of appointment for instance).
What do I want?
Filter (a) specific column(s) on the basis of the current user that is logged on (department field for example) in an agenda view.
The agenda should only show items that match the same text as entered in the department field of the user information field of the user that is currently logged on.
In my case IF Judge1 = Mr. J. Jenkins display it OR IF Judge2 = Mr. J. Jenkins display it. The OR statement is very important since SharePoint also filters with AND statement. So I would like to filter multiple columns with department field (any other also ok, as long I can fill in a value that is connected to the current user).
I already managed to create something that filters all event/tasks/etc list view, searching all the columns based upon the current user department field with or statement idea, but not specific columns. Also in agenda view my code and Alexanders code will not work.
If it is not possible to do this on each specific column it is also ok to search all of the columns since the names in my list are unique for each column. Other columns do not contain their names in such a way anyway. I’m already using my script for the not agenda view and works perfectly except user with slow internet will see the entire list my filter starts working.
Excuse me for long text, but it is complex. Much appreciated any help, suggestion or solution.
Any idea in what direction the solution will be like? In caml? or java? et
Hi,
It will be both CAML and javascript. I have thought of querying the list with CAML to get an array of the ID’s to display. Then loop trough all “items” in the current view, and remove all not in the array.
I’m afraid you will have to wait a bit before i come up with a solution, there are quite a backlog on articles to write.
Alexander
Thanks for the quick response again. Just asked so perhaps I can look in a certain direction en try some stuff. It is what I aspected the direction.
If I figure something out I will let you know ofcourse,
Thanks again.
Just to keep you posted I tried all weekend including today lots of things, but to no prevail. I do know a calendar view for list view won’t accept connections however this was not possible to do anyway in wss 3.0. It is also very clear I cant just adjust aspx page to my liking with javascript or caml query sadly enough.
From now on I will be patiently waiting, it gets to technical if I go any deeper I’m afraid. Finding and especially filtering the calendar items seems the hardest.
This thing is a headache, hope I don’t transfer my headache to you.
Hi Alexander,
Tried filtering with SP designer with no luck. Can’t seem to accept it seems impossible. Perhaps you made any progress on the calendar filter?
Thx again.
Sorry, but i haven’t had time to look at it yet.
Alexander
Hi Alexander:
I am looking for a way to insert code into a CEWP so that my current filter choice in my List View appears as text.
Example:
This report was prepared for: Alexander Bautz
(where “Alexander Bautz” is filter I selected on the [Customer] field.
Thanks-
Hi,
Didn’t this article give you a solution to this issue?
Show active list filter above list view
Alexander
… I think the stress of moving my elderly parents has taken its toll on my memory. Sorry Alexander.
Is there a way though to have the filter tag so I can place it into a CEWP and manipulate it?
Thanks-
Hi Alex
I have two list that are connected through a web connection and I would like to hide a column on one of the lists. As you can see it is a regular aspx form not disp/edit/new.
Can it be done?
Tony
Hi,
Yes it can, i have made a note of this request, but cannot promise anything as i have quite a backlog on requests. You find some to work on in this post vLookup type rollup for SharePoint Look at the hiding of the ID column in the code (a snippet here):
Alexander
Is there a way to dynamically change the description of a field? currently I am using ur script to change title of a field basedon content type. Would like to used the same functionality, just can’t figure to line of code to hide and replace existing description.
It’s kind of difficult to get the description from a field, as it is not wrapped in its “own” tag. If you have plans on changing it dynamically, i would recommend you to handle it all in the script. use something like this:
Alexander
I have another request hoping you can help me finish. It is along the 5 star rating request for items in sharepoint. Currently I have a calculated field, using Christophe’s text2HTML script, like this:
Here are my styles
with this image
http://home.comcast.net/~larry.h.pfaff/stars.gif
I have an alert in the onclick event and this all works. What i cant get or not sure how to do it how to track and average clicks. this set up uses classes to change the stars. It defaults to the class nostar, but I saw you had some code that added or changed a class.
I was thinking that I could create to other columns, number, one could sum the stars clicked and the other number of clicks making it easy to do the math for each item.
I remember you have the other script to update fields in the list view so I know this can be done just beyond my skill set.
I know your busy and I will continue to hack away at this. any help or advice would be appreciated.
thanks again
Update, I have a way, using another calculated field to update the class for the stars.
[sourcecodelanguage=”javascript”]
=”…
StarClass formula
[sourcecodelanguage=”javascript”]
=IF(NOT(ISERROR([stars]/[votes])),IF(ROUND([stars]/[votes],0)=5,”fivestar”,IF(ROUND([stars]/[votes],0)=4,”fourstar”,IF(ROUND([stars]/[votes],0)=3,”threestar”,IF(ROUND([stars]/[votes],0)=2,”twostar”,IF(ROUND([stars]/[votes],0)=1,”onestar”))))),”nostar”)
So now I am trying to fiugure out how to sum stars (in one column) and count votes(in another column) while at least limiting them to one vote per browser session
Larry,
Sorry, but i cannot help you with this as it is a bit complex to look into. I have plans on updating the solution with the 5 star rating system, but there are so little time…
There are probably not much help in me saying this, but i would have handled all this within the original rating script, possibly using “-2”, “-1”, “0”, “1”, “2” as rating and then averaged it to display the correct star combination. The number of votes could be a mouseover or a text behind the stars.
Alexander
that makes sense. the first time I wnet thru ur rating script I was trying a differnt angle and i was not having success. At least I have a new approach.
thanks again
Alex
We have 2 date fields i.e. Start Date and End Date. I want to validate End Date field using onblur event. Validation should check the End Date should not less than Start Date.
Please let me know how can I do this, as I newbie in programming, working on this from last 2 days, still not able to resolve it.
Ple…………..ase help me out
Hi,
Drop this code in a CEWP below the NewForm. Change the fieldInternalNames to match your date fields. The code executes on click on the OK button and aborts save if it triggers.
Alexander
Will presave function work on customized newform.aspx?. I have added my own code for submitting record on onClick event
Hi,
I’m not sure. You would have to test it.
Please let me know how it goes.
Alexander
with the date function here is there a way to build into this a way to default the enddate. What i mean by default is when I click the date picker icon the calendar date in the popup defaults to what was selected in the startdate?
If pick a startdate for end of year, I have to navigate thru the enddate the same way. Making it default to the startdate that was selected would just simplify it.
Hi Larry,
I’m not sure how to “hack” the default date picker to default to this date, but it’s easy to insert the “start date” in the “end date” field, and when the user clicks the datepicker icon, the date will be “defaulted” to the “start date”.
Like this:
Alexander
Thanx A, this was the direction I was leaning. So how can this be modified to change the end date when start date is change? is this fired off with a click function?
i just found out with an alert that the date value doesnt change until the save. Setting date 2 = to date 1 wont work. there has to be another way to set the val of date 2 with the changed val of date 1 before the save. is there a way to use the existing function and write to both fields?
I hate to bother you with this but I cannot figure it out. I have number fields. They hold IDs. I dont want any numeric punctuation added. No commas, no decimals etc.. I know how to create a calculated formula to remove all this, but I am hoping to avoid this route. I really only need this applied in the list view, but every string replace technique I have applied failed. The following is my last attempt. Can you advise what I am missing?
Hi,
You had the syntax a bit wrong:
Alexander
I hate it when I see i was that close. Thanks a million for all your help.
Hi Alex,
This is really great blog!! awesome work and i am big fan of this site, i check everyday and look at the things and learn , but i need something that i cannot find any where. Let me explain what i need..
I have a list with a people picker and a field called email address, i want to get the email address populated automatically depending the person on people picker ( single user). I know that i need to get user information from profile, but i am not a programmer and there i need your help.
I know you are really busy but please spotlight when you have time.
Thanks in Advance.
A helped me with this script that pulls data from people picker fields and auto populates people picker fields, this could easily be set to email. I hate to repost it, but I can’t remember where it was posted.
You need scripts from this site, jquery and a few others.
AccessUserProfileInWSS should have instruction where to get them all.
source list – where data is stored = var arrOfFieldInternalNamesInManagerList = [‘Manager’,’Manager2′];
target list – list to populate = var arrOfFieldInternalNamesInThisList = [‘Manager’,’Manager2′];
this script hides the user and manager fields, and auro populates them. you can unhide the fields and populate different data.
Hi,
I’m glad you like my blog. I have made this solution for you: Pull e-mail from people picker and write to a separate textfield
Please add further comments to the article linked to above.
Alexander
Your stuff is awesome, I have an issue and are curious as to what you would recommend for this.
Scenario: organize list items in folders where name is field value entered into newform.aspx
Requirements: create list items in correct folder without user intervention,
Considered using SP presave action to create folder based on list field, not sure how to add item to that folder.
Folder path is populated in query string with ?RootFolder=/Lists/List/[Folder], List field is single line text
Any help is appreciated
Thanks, Joe
Why do you need folders? There are many arguments out there on the pros and cons of folders. Personally I feel the Meta data can handle 90% of this concern and is very easy to implement.
One problem you may have with the creation of folders by end users is the lack of consistency you will have from user to user. This could become a maintenance nightmare after you have 100’s of folders created in a library. If you restrict the naming convention they you may run into the duplicate folder names.
There are also topics that folders interfere with custom views. I am not 100% convinced of this, but it does present problems. Go with the Meta data it is much easier to regulate and standardize.
Hi Joe,
I support Larry’s comment above. Though it may be possible, it will rather quick get “dirty”. If you need any more, please post further comments on this thread.
Alexander
I have an observation form with 6 radiobutton fields. the options for all 6 fields are the same:
– complete – Not complete – Partial complete – N/A
on the newform or edit as the user makes selections I want to tabulate selections in 4 additional fields (Number). One named for each of the options.
– complete – Not complete – Partial complete – N/A
I can set a field value with pieces of your scripts. I am not sure how to trigger the count when an option is selected.
this is only half. How can I count the Complete field each time complete option is selected from any of the questions. And how can I decrease the count when Complete is deselected.
Not just compelte, all options for all fields.
Hi Alexander:
(related to your vLookup solution) –
I need to be able to import/paste a list of employees where one of the fields is the employee number. I can’t import it as a number because I need the leading zero’s (mine is 007064).
I would prefer importing this number into a Person or Group field, “automatically” prompting the List to authenicate it against my users.
Once this employee number triggers the authentication, I can filter by [me].
Any ideas how to import a number and then trigger an “automatic” Person or Group authentication?
As always, Thanks-
Charlie Epes
Buffalo, NY
you can handle this a couple of ways. First is the the number field can be a single line text. this would allow import of leading zeros. If you can go with a single line field and you need a number. add a calcualted field to read the number and set the fiels to the length you need which will add leading zeros like this:
Hi Charlie,
My first thought is to use excel (and vLookup) to find the loginName for the users (matched from another source/sheet) and to paste the loginNeme in a SharePoint datasheet view (just set the people picker to expect loginname in the list settings).
This will be far easier then using javascript to match the employe number with loginName.
Alexander
Thanks – both of you-
I forgot I can set the people picker to expect loginname… duh.
I’ll try it.
Thanks-
New request I believe it is fairly simple. By the way congrats on your article making it to EUSP.
Again I hacked another piece of your code to color the background of the heading of a grouped view.
running the code like this tasks the resources so i modified it like this
this applies color to the first and second level grouped items. I would like to apply a differnt color for the second level, but I am not sure how. I have not been able to find a way to distinguish the two levels apart. any suggestions?
Thank you,
I’m not sure if this is what you try to achieve, but try this:
Replace the “dummuyClass with the class you want to use.
Alexander
You are my hero!
Hello.
I have a list with about 25 columns which is too wide to fit horizontally on most monitors.
Is there a way to dynamically collapse and expand columns in a SharePoint list (using jQuery) so the user can choose what columns to view?
Hi,
I have thought of making a solution like this. It is in the “queue”, but i cannot promise a delivery date.
Alexander
Alex great work as normal, I have a page with multiple lists that are filtered I would love to be able to hide the list if the filter returns no records, is it pauseable?
Tony
I have another request. I have been hacking away at a piece of your code from the rating script. I want to hide a column, multiple columns. In that script you hide the ID column. I also saw another post similar to this. I even tried that code but no luck. this only hide the header cell
what do I not see? what am I missing to hide the column StatusFlag
just saw the previous post. I dont need dynamic right now. would be happy to just hard code it.
The code is for the table header only. You must iterate over all the tr’s in the table and hide the td where ‘cellIndex’ equals IDcolIndex.
You find the code in the posts you refer to, just search for “cellIndex” in the code.
Alexander
thanks I will look into it
I went through the code some more and was able to find what I think you were talking about. I made a few modifications and put this together . Now I’m getting an error on the page
‘g_ExpGroupState’ is undefined
I know I am close because the header is hidden, but I have lost all data in my grouped view. Headers are there, just nothing below them.
can you see anything obvious I may be missing?
I finally got it. I was missing one more lines of code. Now moving on to adding checkboxes to hide and show.
So I have it working now and I added a checkbox to work on the hide show. It seems the the function only fires once on the click function for a checkbox. Do you know how to trigger the event for each click of the checkbox?
How does the code for the checkbox look? – my first thought is that you must use “click” and not “change”, and check the myCheckbox.attr(‘checked’) for true/false.
Alexander
thanks, I have been back and forth with change and click, not getting either to work like I want. Here is my function and checkbox
this seems to fire only once. I also tried by checking the attr but then it only fires once as well
can you see what I am not?
Here is a working code example (my column is named “HideMe”:
Alexander
BINGO! thanks a milllion. I would have never got it. I owe you.
I have a request
I have 5 content types for a list Eg: Content Type A, Content Type B, Content Type C, Content Type D, Content Type E
and I have 4 or more Security groups, say as Group P, Group Q, Group R, Group S
Now my scnario is Group P should see Content Type A,
Group Q should see Content Type A,Content Type B,
Group R should see Content Type D,Content Type E,Content Type C
Group S should see ALL Content Types data
Is there is a possibility,.. ?
Yes, ther are two main script that come to mind from this forum that you could use to achieve this result.
Identify content type to execute content type specific code
https://spjsblog.com/2009/11/20/identify-content-type-to-execute-content-type-specific-code/
and
Showing or hiding list fields based on membership in a SharePoint group
https://spjsblog.com/2009/09/20/showing-or-hiding-list-fields-based-on-membership-in-a-sharepoint-group/
these two scripts in combin ation can achieve what you need
Alex great work as normal, I have a page with multiple lists that are filtered I would love to be able to hide the list if the filter returns no records, is it pauseable?
Hi,
Try this in a CEWP below the webparts to hide:
Alexander
you made a post to change external links. I an trying to modify this to change an attribute. the problem is I dont have access to the parent frame because it is hosted by a vendor. ther is an email link in the parent for help. it is a mailto link. I was hoping there is a way to change this through script. this is what I have so far
Through a UI I can change the email address, but I do not have access to the link attributes.
Is there a way to access the parent frame of an iframe and remove the “mailto:”?
I’m not sure, but if you wrap he code like this:
Does it help?
Alexander
I have a simple request. I would like my attach file button open up an excel spreadsheet. once they fill it out, then it saves the way a normal attachment does.
In a nutshell I need the attach file button to work similar to how the new item work from a doc library that has a pre-defined word doc template.
Hi,
I’m afraid this is not a simple request… The “add attachment” is based on upload from the users hard drive. A spreadsheet would have to be saved locally by the user and then uploaded.
I have no immediate solution to this request.
Alexander
thanks for all your help
Hello
I have dropdown field in newform/editfor. This drop containing US States and “Select State” as first option. It is required field. I want that If user doesnt select any state, leave “Select State” as default value, my required validator message should display.
is this possible
Elstone
Hi,
Add this code below NewForm and EditForm:
Alexander
Hi Alexander
We have a form on which we have three person fields. What we would like to do is make fields on the form read only based on which person field they are included in. Is this possible?
Thanks
Andrew
How are you setting up the people pickers? I am trying to understand how you know a person is in a pp field and not all. Will the field be populated with a value? If so I could see easily grabing the value.
Playing with some simple jquery and hacking some of A’s code here is the code to hide a people picker. if you add it to a function that checks field values and compares against user. the following posts could help you identify the user for comparison.
Autocomplete for SharePoint people picker
Link to fill user login name in people picker
Sorry I don’t think I explained myself very well. What we have is three people picker fields employee, manager, director that would be filled out on the newform. Once somebody goes in to edit the form we would like each person to be able to edit certain fields.
So for example the director would only be able to edit a specific number of fields and the rest be read only. The same would apply to the manager and employee.
Does this make sense?
Thanks
Andrew
So then A has this script Showing or hiding list fields based on membership in a SharePoint group. this script hide/show fields based on user in a group. Although not exactly what your looking for it is a start.
Thanks Larry we use this feature elsewhere but in this instance on the edit form we require users who are filling in the form to be able to see the fields that have been entered by other users. This means we require to make the fields read-only and not hide them.
I apoligize, instead of hiding the field set the attribute to readonly. I know there isnt a script readily available here. At times I have found myself taking pieces of code from many of A’s posts and putting them together for my solution.
Again I apoligize, I know there isnt your exact request visible, but there are close representations that you can piece together or modify if you have some development background. I would be willing to help you if you want to try.
Using the logic from this newly added post: Get field value for all SharePoint FieldTypes or set field as read only in EditForm
Here is an example:
Alexander
Hi Alexander
This is exactly what we were after and works great!
Many Thanks
Andrew
Hi Alexander
We are trying to use this script alongside the fields side-by-side script but I cannot get them to work together. Any ideas or suggestions.
Thanks
Andrew
is there a way to create an assessment type functionality? Your HTML tooltip displays text on hover from another list. is there a way to create an intake that can compare data from another list (questions, questionID, answerA,answerB,answerC.., correct answer) and on submission have it return user selections in addition to a right/wrong answer, pass/fail status column(s)?
Hi,
Thank you for helping out answering questions.
About the request: It is possible, but i think this would be a bit to specialized and a bit to much work to post here. If you set up a more detailed description and email it to me, i might take another look at it.
Alexander
In a document or form library there is a function you can access in the settings called “Relink documents to this library”. I have a large need for this when dealing with InfoPath forms and republishing. This page allows you to see the documents in the library and the template path. Each item has the option to be selected, then relinked. By default you have to select one at a time or click each checkbox.
I built a “select all” webpart and added it to the page and it works perfectly. The view is set to 100 items at a time with paging. There is no way using the UI to change this. However; I can change the page source and manually change this number.
I do not like making the change this way because it removes the page from SharePoint and make it like any webpage by unghosting it.
What I want to do is add a simple script that will replace the rowlimit of 100 with another number but I can not seem to access it. In the Forms/repair.aspx source this is the part of the code i need to change
[sourcecode]
<RowLimit Paged="TRUE">100</RowLimit>
can it be done using jquery?
I do not think it is possible that way, as the view is specified in the list schema and any modification after the page has loaded has no effect.
However you can modify the view from within SharePoint with a small “hack”:
Get the view GUID from the relink view (view source and search for “ctx.view”), copy with the braces like this {439B16F7-B588-4E87-9558-7B33E9E5FADF}.
Then go to another view in that list, click “modify this view”, then replace the view GUID in the URL at “&View=” and reload the page.
Alexander
I can live with that. That was easy. thanx a million.
one more question on the relink page. I have a decent select all function. I have been able to add it to the tool bar and just below the relink label for that column. What I want to do is hide the column title “Relink” and replace it with my string “str” for select all. Either I hide the entire cell or I get an error. this will append the “Relink” text
[sourcecode]
$("th.ms-vh2-nograd").append("<div style=’font-size:7pt’>"+str+"</div>");
what will replace? I cant figure out the syntax.
Hi,
Not sure if this is what you want, but replace “append” with “html” to use your div as the header title.
Alexander
I have almost completed this task on the relink page. I can write a checkbox in the relink column header, but I can’t get it to format clean. I tried to do a string replace with jquery but not successful. I finally got a solution to work.
can you take a quick look and let me know if there is a better way?
all I want to do is hide the text “Relink” and replace it with my “str”
Alexander
Thanks for previous info. New general knowledge request. I have an intake using several of your scripts. The newform and editform scripts are almost identical (hide content type field only difference). The new form works perfectly. When I edit an item some of the scripts appear not to work. When I set the page into edit mode, they begin working. What can cause this to occur?
I figured it out. What I have been doing for simplifying maintenance I add all my external scource file links into a text file, link the CEWP to the text file.
I do the same thing for my functions, I have one for the NewForm and another for the EditForm, both share the source file links. Much easier to edit in a text file than a CEWP. What I found was the source file links were not loading in the page until I put page in edit mode. I don’t know why. I deleted that CEWP added a new one and recreated the link to the file. works fine.
thanks again
Hello
I want to implement following process in “Delete Item” from ECB Menu and from fispform.aspx form tool.
1. Can I set redirection whenever user click on “Delete Item” from ECB menu or Form Tool bar
2. Is this possible if we can add one more button/option in Form Tool Bar of “dispform.aspx” thne clicking on this new page redirect with page source as query string to another page.
Please help me
Hi,
For modifying the delete function i would recommend an event handler and not javascript. Even though you can override the default functionality when deleting, this must be added to every view of the list.
To add a new menu option use this code in a CEWP below the form:
Alexander
Hi Alexander
Is it possible to use the readonly field script I requested above with your fields side-by-side solution? I don’t seem to be able to get them to work together.
Any help would be appreciated.
Thanks
Andrew
Everything is possible, but i have not had the time to look at it. I think it will require modification, but is possible.
Try to change the order of calling the scripts as it may be important.
Make a go at modifying it and let me know how it goes.
Alexander
Hi Alexander
I have played around with re-ordering the scripts but have had no joy getting them to work together. It just repeats what is contained it the first field and repeats it across when they are made read-only.
Thanks
Andrew
Hi Alexander,
after having implemented a number of your great scripts, two new thoughts crossed my mind. Well, they are not exactly my ideas but have been inspired by your scripts.
To start with an easy one (maybe), we are using document libraries with grouped views to display data to the customer. With the help of some other script I managed to get rid of the “Group by part left of the ‘:'” (I’ll gladly provide the script if you are interested), which gives a much cleaner look. Now I would like to limit the number of displayed items per group to “x”, or maybe even depending on the group to “x or y”, but SP only allows to set a limit for all items on a page.
It’s a bit like “display only the last x|y items” for group “x” or “y”.
The second one is related to list views, I got this idea when I saw your article about column visibility. As of today, we are using an excel report to show report data for the last four calendar weeks. The data and the “column” shift have to be done manually. With the column visibility article in mind I thought if it would be possible to have SP automatically ‘shift’ visible columns, thus showing the ‘current’ and ‘current-x’ calendar weeks?
If you need further details on this let me know.
regards,
Chris
Hi Alexander,
any chance you can have a look at this?
regards,
Chris
Hi,
Unfortunately my kitchen renovation has eaten away from my “blog time”. I cannot come up with a solution right now, but if you look at my other scripts that “interact” with a grouped view, you can start off by yourselves.
The trick would be to limit the number of “tbody” elements rendered (hiding or removing the excess).
Your other question is related to this comment You might create something based on this solution.
Alexander
Almost forgot, I’ve got a link tipp for you. Maybe you can grab something useful there.
http://www.tripwiremagazine.com/2010/04/24-irresistible-jquery-tips-to-power-up-your-javascript-skills.html
Chris
Good Day A,
Some time back you helped me with the syntax to hide commas in a list view. works perfectly. I would like to take it one step further. for the headers, where we can sort and filter, the comma still displays here.
Can comms (or special characters) be hidden or removed from the filter menu of a column header?
Hi All,
This is Krishna and i am new to this blog.. And coming to point, my requirement is: When we want to view a particular item in a task list, just we will click on item and the record is shown in DispForm.aspx. If we want to view any other record again we should go to task list and click on the required item record.
My requirement: I need to create a “Next” link button on DispForm so that when user the user can view the next record without goin to tasklist again and clicking on next record.
Any help/solution/suggestions will be grateful.
here is a proof of concept. I borrowed this script from Christophe at blog.pathtosharepoint.com and made some modifications. the result has a prev and next functionality. with some work you can make it fit your needs.
the original function displayed the item ID either at the top of the form or the bottom, but not both. The bottom is commented out, but you can swap them around.
let me know if you have any questions
two more notes.
1. I miss a set of “=” signs on line 21
should be this
2. if the next or previous ID does not exist you will get an error. you may need to create a check that determines if the next ID exists. If not go to the next.
Thanks larry..Thats realy good. But i need some modifications on that. i.e when we open first item and click prev button it is showing some junk values. If we are at first record and the user clicks on Prev button we should show a msg that its first record.
One more important thing is i need the basic idea of this how u created and can u give description on this bcoz i knew javascript but i never used the methods and attributes u have used…Please help me on this k..
Thanks
K.K
Hi this praba,
Please advice / help me to build the below scenario.
Scenario 1
Batch update using Data view Web part and select all checkbox.
1.In a data view web part
2.Select records to be edited using checkbox
3.Edit multiple records fields
4.Click the update link to update all the records to sharepoint list.
Scenario 2
1.I have a custom form build using asp.net
2.Populate same form with SharePoint list data’s
3.And update from same form to SharePoint list.
Please help me build the above scenarios,
Millions of thanks in advance.
Praba.
Hi,
I’m afraid this is a bit to specialized for me to do as a “general” blog article.
The first scenario however could be derived from my article Edit date, single line text, number or boolean columns directly in list view, but making both the first and the second request come trough would require a specialized solution that i regrettable cannot give you.
Alexander
Hi Alex:
Please give some tips and advice to achieve the above Scenario 1 and 2, because I am very new this areas.
Thanks
Prabakaran
Hi again,
Sorry, but as i wrote above, this one is to complicated to create as a blog post.
It’s possible, no doubt, but may take hours upon hours to create. Unless you can learn from this (and other) blogs and begin writing the scripts yourselves (and ask if you have specific issues), i cannot help you with this one.
Alexander
Hey A. Hope you’re well. I was trying to add a script to set the width of a text field. I can make it smaller with no problems. Trying to make it wider than 300px 400px can’t do on a new or edit form
Any suggestions?
Hi,
try this using the function init_fields():
Alexander
Hello
I want to hide toolbar completely when user is belong to “Requester” sharepoint group. How can I do this?
Is this possible?
Hi,
You remove the toolbar like this (supports multiple webparts in one page.
To hook it up to a user group, look at this article: Showing or hiding list fields based on membership in a SharePoint group
Alexander
Hi Alexander…. great job with your blog. Has been very useful so far.
I wanted to ask if you have any solution for dynamic fields into another form.
The idea is for example, fill a new form with a course information, and have fields with name and e-mail address. Then i can complete this two fields, and if i want i can press an “Add” button, so dynamically appears another 2 fields with name and e-mail, and so on.
This 2 fields, should be saved on a diferent list, and be linked by his ID with the course information.
Would it be possible?
Regards,
Nicolas
I want to Hide “Site Actions”,”View All Site Contents” and “Sign in as Different User” for all the users who does not belong to “Administrator” group, How can I do this?
Hi,
I do not think javascript is the way to do this. The code would have to go on every page in the site.
A feature or custom master page could be used (security trimming the controls). I’m not the guy to talk about regarding this approach, but here is how you could do it with javascript (place the code in the master page to load it in every page, or use SharePoint Infuser
Use this post Showing or hiding list fields based on membership in a SharePoint group to learn how to get the list collection from a user. You will have to pull parts of the code and combine it with something like this:
Alexander
Hi Mr.Alexander,
As per your instruction, i’m posting the request here. I have a long pending urgent requirement as below.
I have a simple list with below mentioned columns(fields).
1. Title 2. Part No. 3. Part Name 4. Model 5.Make 6.Comments
While creating these columns, i have given some detailed information about these columns in the “description” field of the respective columns.
As we all know, this description can be seen by users who have only “Edit Permissions” for the list.
Requirement is, just to display this description as a tooltip when a “read-only” user of that list hovers the mouse on the column(field) in “DispForm.aspx”
I have seen lot of solutions which are showing tooltip at items level for the list. But, here i want to show tooltip at “column(field)” level.
Could you please check and help me on this?
Awaiting for your reply with anticipation.
Thanks in advance.
Hi,
Pulling the description from the list schema is possible, but is it something like this Add HTML mouseover tooltip you are looking for?
Let me know if you rather would use the native description for the field and i could write a solution.
Alexander
Hi Mr.Alexander,
Thank you very much for your prompt support.
In my earlier request, i have mentioned wrongly as “DispForm.asp” by mistake.
Actually, we need to show the tooltip in “AllItems.aspx” page of a list.
When the user sees the SPGridView and hovers the mouse on the grid column header, we need to show “description” property information as tooltip of that particular column which was given at the time of the column creation.
Information in the blog “Add HTML mouseover tooltip” is to show the tooltip at edit mode/Editform whereas we have to show column description as tooltip at “AllItems.aspx” page.
Eagerly awaiting for your reply with anticipation.
Thanks in advance.
Hi Mr.Alexander,
Could you please check for the “tooltip” requirement given as a reply to your response ?
Awaiting for your valuable support
Thanks in advance.
This example does NOT pull the description from the field itself, but enables you to add the text directly in the script. This is a bit easier to implement. Look at the code and edit the variable “myTooltipObj” to match your columns and descriptions.
Does this answer your request?
Alexander
Hi Mr.Alexander,
Thank you very much for your reply.
I have added your javascript script and implemented in my list.
On click of my “list” link on QuickLaunch, list is displayed but the tooltip is NOT displayed on mouse hover to “title” column.
I added a alert statement and checked. This alert is fired on only “page refresh” and not on Mouse Hover.
Should i have to add anything else to fire mouse hover ?
Could you please help on this?
Thanks in advance.
Hi Mr.Alexander,
Thank you very much for your reply.
I have added your javascript script and implemented in my list.
On click of my “list” link on QuickLaunch, list is displayed but the tooltip is NOT displayed on mouse hover to “title” column.
I added a alert statement and checked. This alert is fired on only “page refresh” and not on Mouse Hover.
Should i have to add additional code anything to fire mouse hover ?
Could you please help on this as i am very much new to jQuery?
Thanks in advance.
Hi,
Sorry for the delayed response. Add the code i provided above to a CEWP and place it below the list view.
If this does not help, please email me some screenshots and i will try to help. You find me e-mail here
Alexander
Hi Mr.Alexander,
Yes, we have also done the same. But it was not showing the tooltip on hover the mouse on title column.
After seeing your reply, again i went to my list and checked. When i have hovered the mouse with little bit space away for the column text “title” ( but within that column area), the custom tooltip is displayed.
Hope this will work for any custom columns !
Excellent work !!! Thanks for your prompt support !!!
If i hover the mouse exactly on the word “title”, tooltip “Sort By Title” is being displayed.
Still the below things are disturbing our minds.
Could you please check and clarify below things for me?
1) Is it possible to remove this MicroSoft standard tooltip (for both pre-defined and custom columns) ?
2) How about “Pulling the description from the list schema” as you mentioned earlier, which was already given by us at the time of column creation.
As we want to show the information given in the “description” property of the column given in add/edit mode, is it possible to show that information instead of our static information using the above procedure ?
If the second approach is implemented, then we need not have to do anything extra work when a particular column’s description is changed.
If it is not possible, then we will go by the way you have suggested above.
Once again thank you very much for your support.
Thanks in advance.
Awaiting for your reply.
See this article: Show field description in list view column header
Alexander
Hi Mr.Alexander,
Thank you very much for your prompt support.
This is what i was expecting.
Excellent Work !!!
Thanks a lot for your valuable time spent on the same !!!
Thank You.
Saran
Hi Alex,
Do have any tips for using JQuery to Custom sort a lookup list? I’d like to do concatenate ID and Description in a lookup field.
Hi,
Is it a “Single item lookup”?
Alexander
Hi Team:
One of my column is to be unique.
How to fill this requirement using Jquery to enforce uniqueness in any Single line of text column.
Regards
Praba.
Hi,
This article answers your request SharePoint list’s or document library’s: Primary key in selected field
Alexander
Hi Alexander,
I have been using your solution for filter list by group membership. Recently we have a requirement to filter list by user profile, this has to be done because of some issues with “only their own” settings. would you be able to modify your function “filterListViewByGroupMembership” to filter view by userid/login id? tried to do it myself but i cant seem to filter it right. many thanks
Answered here
Alexander
On the edit or disp form, is there a way to hide or remove commas from a number field? I have been able to do it in a list view, but not the forms.
Hi,
Under list settings you can set the “Number of decimal places” to 0.
Is this not an option?
Alexander
That work for the decimal, but not commas. I have an intake that user an emp id. it is easy to copy the id rather that type it, but this 9 digit field adds to commas. Is there a way to do a replace on these forms?
The commas is the “thousand-separator” based on your regional settings. SharePoint will always add it to DispForm and to EditForm (as you said), but If the input is indeed text, why not convert the field type to text?
It is quite easy to replace the commas, but if you do not need a script it would be even better.
Alexander
I do understand. For some time I have struggled with this field. Initially it was setup as text, but there are no id’s that are alphanumeric, yet we still have people that do not understand with their emp id is. So I converted to number. The delima I have now is if I go back to text, I need a script that will only allow numeric values, if I stay number field I need to strip the commas, lol.
which, in your opinion is the best way to handle this knowing I will eventually have to add a script of some sort? which leaves the smallest footprint?
I think using a text field is easier – here is some code for you Numbers only in single line text field
Alexander
One more thing – if the “emp id” is found in the users profile, you can pre fill this value for them.
Alexander
you are the best. I think when we upgrade to MOSS there will be more emp info available, but for now we are stuck here. thanks for the quick turnaround.
I was recently asked if wikis support bookmarks. With the research I have done it is supposed to be true. The first page I created with bookmarks worked perfectly. When I added updates, the bookmarks went from relative to absolute links and now they open the edit page. Going back to a script you wrote to modify href attributes in a web part I am trying to figure out how to remove the URL up to the “#” in a wiki page.
turns into this
what is the easiest way to remove the URL up to the “#”? I can’t get it.
if removing the URL is not the way, can we do a replace with the current page URL, which is ultimately what would work best
Hi,
Try this:
Updated 24.06.2010
Alexander
Perfect!
along this similar line. Within the wiki, which I dont believe matters. I say not matters because I have had the same issue using a CEWP. I have created a unordered list for navigtion. it is layed out horizintally. I want its position fixed. CSS wont work. I is enclosed within a div like this,
[sourcecode]
<div id="menu">
<ul>
<li><a href="#a"><span>Alpha</span></a></li>
<li><a href="#b"><span>Beta</span></a></li>
</ul>
</div>
How can I get this to have a fixed position when content on the page scrolls?
Update: The bottom solution is IE only…
My initial suggestion (but look below for an easier method):
Never mind that script – it is not necessary to use a script… I still have a lot to learn about CSS:
Update: This solution is IE only…
This is the easiest method
I learned this from this article about frozen headers in a list view: Scrolling View with Frozen Header
Alexander
great job. Much further than I was able to get. The first solution worked the best except for the alignment. The top navigation (list)sometimes falls on the text when navigating.
the second script i have tried several different ways to implement. On the wiki page I added a CEWP with the style and list. it sits at the bottom of the wiki and does not scroll or move to the top. here is the code in the CEWP
then I moved the list nav to the wiki page
what I found was that the content needs to be wrapped in a div and I could only make it work placing it in a table reading from that same reference you mentioned.
How can I make this work, frozen div head, scrolling text, without having to add a table?
I know I am bothering the heck out of you with this. I almost have this complete. I just found this last issue and I dont like the way it is functioning. I have the top navigation which is an unordered list layout horizontally. My content is in a div with an OVERFLOW: auto; HEIGHT: 420px
this allows the content to scroll up to the navigation tabs (bookmark links). in the wiki if I click a tab the entire page scrolls to the top right to the bookmark, hiding the tab navigation. I found this only happens when the SP page is already longer then what can be viewed on screen.
1. how can I stop the entire page scrolling and only scroll the content of the div.
2. I have a script to add/remove class on the tabs but only on hover. how can I add the same class when I click, but also remove that class when I click on another tab. Only want one tab with the class at a time like the hover function here:
when I add a click function I lose the hover. any suggestions?
Hi,
This is a bit to hard to piece together… If you could send me some sketches of what it is you want to happen, along with the code, i might be able to help.
Alexander
Hi Alex,
I am trying to create an presave action to make sure the client is sure before they submit the form.
Hi,
This is previously posted as answer to the same question:
Add a CEWP below the list form in NewForm and EditForm. Insert this code:
SharePoint automatically executes any code in this function when pressing “OK”. It must return true for the save item to take place.
Alexander
Hi Alexander,
is it possible to redirect new- and editform.aspx of a list to e.g. a webpart page? I’d like to set up a webpart page with cewp’s in the middle and on the side. The side webparts will be used to display additional information, the middle webpart(s) will be used for the new/editform.aspx
Chris
The default NewForm, DisForm and EditForm are defined on the list in SharePoint Designer. I think you could create a custom NewForm in SPD and use it, but i do not have any detailed walktrough on that as i newer modify the form other than using client side javascript…
Alexander
is it easy to have a popup window say from another list in SP. that a user can open scan the list click an item in the list and have it write that item to a field of a newform or the same or another list. It cant refresh the page or previously entered data could be lost.
I have a location list broken out by country, 150 locations, 12 countries. I dont want to add addition additional fields (cascade). I though a popup win work a bit easier. when they get to this field they click to open the popup, find the location code, click the code and populate the field in the original newform.
How hard is this to accomplish?
Hi. I’ve been looking all over the internet for a clean way to simply query individual columns of data from a list.
I would like to take a column and put all of the data into an array and then use that array elsewhere in my code (in a CEWP). So many blogs and posts seem to tell me what to do but I don’t think know enough about JQuery to understand exactly where the extracting of data is taking place. More importantly what jQuery libraries or functions would I need to use to perform such a function. I’m not looking for written code per se, I just am looking for a plain English explanation of what i would need to do.
Thanks if you think you could help.
don’t worry about this post, i have other questions in one of your blog posts
Hi Alexander,
I want to to be able to hoever over the name of file (Infopath) in form library and popup an image which is a hyperlink to picture in picture library and is related to the infopath form.
Regards,
Osama
Answered here
Alexander
Hi Alexander,
Is there easy way to freeze the column panes in a view?
Look here for a solution:
Scrolling View with Frozen Header
Alexander
Using your init_fields_v2() to create a fields reference, how can I remove specific options from a SharePoint Select dropdown menu on one of my lists?
Hi,
This example removes the options Green and Yellow from the <select> with FieldInternalName “MySelect”.
Add this code to a CEWP below the NewForm and/or EditForm:
Modify the “src” to jQuery.
Alexander
Awesome! Thanks!
Hi Alex,
I’ve just got another question regarding this post
https://spjsblog.com/2009/11/05/requests/comment-page-7/#comment-3340
You’ve referred me to try
Unfortunately I’m not enough of a programmer to make this work with calendar weeks. From what I’ve made up so far (theoretically) I have to create 52 columns representing the weeks for a year. Then I have to create views that show 4 weeks, starting from cw01-04 and so on.
My problem starts with the calculation of the correct week for this ‘autochanger’ and continues to the part where my columns should show the reporting date instead of a calendar week, e.g. 01.01. 08.01. 15.01. and so on, increasing by 7 days.
I might be able to change that to a calendar week naming, however I’d still have a problem in the new/editforms since I don’t want to display 52 items all the time when only one is necessary (the current week item).
Can you nudge me into the right direction regarding a calendar week calculation for the sript above?
thanks,
Chris
Hi,
I’m a bit confused. I have read your original request and then this one. I must admit i do not quite understand what you want to achieve.
What kind of information is supposed to go into these 52 columns?
Please e-mail me some sketches or some more details and i might be able to help.
Alexander
Hello Alex,
I would like to ask you for some help, as i am trying to make a field update mechanism on the dispform.aspx. For example, when i open a sharepoint item and see the display form to have a button and when clicked to update the same item on a specific choice field only, in a way to manipulate it, from Status In Progress to be able to set it to Completed or something like that.
Regards,
Esad
Something like this Get or Set value for SharePoint field in NewForm, EditForm and DispForm (Get only in DispForm), just to be able from a buton on the DispForm to update a hidden/non-visible field.
Hey Alex, another question for you:
How would one, using your init_fields_v2() function, set a multiple lines of text control to be disabled and change the width of it?
I’ve been toying with it for some time now and decided to turn to the master for assistance. 🙂
Thanks!
Scratch that, I figured it out finally. 🙂
Hi Jason,
care to share the solution with us?
I have seen some fo the script where you can hide list view menu and hide individual items (views). Is there a way to dynamically change the label. I am creating some views like, Current Year, Last ayear, Current Month and Last Month.I would like to replace the text with the current date.
Current Year = “Year – 2010”, but next year it reads “Year – 2011”
same for month
Current Month = “July – 2010”, but next month reads “August – 2010”
can this be done?
Hi,
The people I’m working for have a request to basically “google” search a very large list (800+ objects). They want to be able to enter in a few keywords into a search box and have a filtered list returned. They don’t care which column the term falls in, it should all be found in the search.
I’ve currently implemented this idea using Javascript, but it has some limitations. First, it can only search the entire list if the entire list is visible to begin with. With 800+ items and IE6 requirement, this is bad. 2nd, it’s pretty darn slow on IE6 which is what I’m stuck with using.
My knowledge of JQuery is pretty limited so I’d be very thankful if there was a faster better solution than what I currently have.
[sourcecode language="Javascript"]
Search: <input id=tSearch class="ms-long" type="text" onkeyDown="return entsub(this.value, event)" />
<INPUT id=btnSearch onclick="return filterWords(document.getElementById(‘tSearch’).value);" value=Search type=button>
<INPUT id=btnClear onclick="return clearPage();" value="Clear Quick Search Results" type=button>
<INPUT id=btnClear onclick="return rese