Hot answers tagged

8

Check http://sharepoint.stackexchange.com/a/52877/35604: <script type="text/javascript"> function Custom_Submit(command) { SP.Ribbon.PageState.Handlers.showStateChangeDialog(command, SP.Ribbon.PageState.ImportedNativeData.CommandHandlers[command]); } </script> <input type="button" ...


7

There's not a huge difference for all of them. 3 out of 4 of them are server-side controls. And the SharePoint:InputFormTextBox and wssawc:InputFormTextBox are the exact same, only the prefix namespace (i.e. SharePoint, wssawc) is the difference. SharePoint/wssawc:InputFormTextBox has built-in co-operative field validation, the others don't. That's the ...


5

Add an id: <pre id="myId" .... And then hide it with jquery: addNewTest = function() { $('#myId').hide(); }); or without jquery: addNewTest = function() { document.getElementById('myId').style.display = 'none'; });


4

You wanna target the specific webpart where you wanna change the link color, otherwise every link on the page will change font color. Use F12 Developer tools to find the ID of the specific webpart you wanna change the link text for. Insert the name/ID instead of my example (#WebPartWPQ5) and then use the CSS i provided below (SP2013). <style ...


4

A ductape patch is adding a negative margin-top <div style="margin-top:-200px"> YOUR CONTENT </div>


4

Find id of that WP. Something like WebPartTitleWPQ4. Edit that page and insert script editor WP and add <style> <style> #WebPartTitleWPQ4 h2 { background-color: #000; color: #fff; } </style> EDIT Find where is title. For ex. <style> #WebPartTitleWPQ4 h2 { background-color: #000; } #WebPartTitleWPQ4 h2 span { ...


3

You should be able to insert your HTML code in a copy of the default master page you are already using, download it locally and and then publish it and set it as masterpage for your sites using O365 dev PnP Powershell cmdlts. As i'm not using O365 myself i haven't been able to try it out but should be doable. OfficeDevPnP.PowerShell Commands There are ...


3

You are using jQuery already, so rather than use the regular onClick, can you take a different approach altogether, and use jQuery to wire up a click event handler? That way you can call your function like you do in line 649. I'm thinking a different approach like this: $("#head"+i).click(function(e) { startWorkflow(id, anbieter); ...


2

You can use script Web part and insert a tag style .ms-headerSortArrowLink{visibility:visibility !important; } The important should override the in line style


2

SP.UI lives on another file, that is sp.ui.dialog.js You need to add it to the script references <script type="text/javascript" src="_layouts/15/sp.ui.dialog.js"></script>


2

I'm using this: <script type="text/javascript"> var loginName = ""; var userid = _spPageContextInfo.userId; GetCurrentUser(); function GetCurrentUser() { var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")"; var requestHeaders = { "accept" : "application/json;odata=verbose" }; $.ajax({ url : requestUri, ...


2

HTML: <div id="wrapper"> <div class="float left">left WP zone here</div> <div class="float right">right WP zone here</div> </div> <div class="bottom">bottom< WP zone here/div> CSS: #wrapper {width:600px; height:300px; position:relative;} .float {background-color:black; height:300px; margin:0; ...


2

There is an WebPart called PageViewer-WebPart you can use for this purpose. Here's some reference for that: https://support.office.com/en-us/article/Display-a-Web-page-on-a-SharePoint-page-by-adding-the-Page-Viewer-Web-Part-7f61feec-9b3d-4805-a960-07636ba59527 You may have to take care of the 'SAMEORIGIN' security, but there are a lot of references on how ...


2

I would suggest to use a simple IDE to develop your code. This IDE will help you by finding simple errors. A free example for a IDE is Visual Studio Code but there are loads of IDE's for you to choose. Here's the output if I paste your code: After knowing the simple errors fixing is not the problem - at least the ones caused by bad syntax.


2

Depending on what you are using the html files for, you can try changing the extension. For example, call a file content.html.txt. One thing I store html files for is to link them to content editor web parts. In that case the extension doesn't matter.


2

Ok, here's what's happening: // select ALL elements that are .block .title h2 span and loop through them $(".block .title h2 span").each(function(index) { // find the length of the text of THIS PARTICULAR element var x=$(this).text().length; // if the length of THIS PARTICULAR element is > 29 if(x > 29) { // change the ...


2

You need to render the rich text. Just add STSHtmlDecode like in this example. <div id="trimmedDetailsDiv" class="newsListItemBody" style="padding-right: 0px; color:#656565; font-size:15px; padding-bottom: 25px;"> _#= STSHtmlDecode(shortDescription.value) =#_ </div> SharePoint 2013 - Working with Display Template for Content Search Web ...


2

This site allows you to create a timer, then it outputs the code for you. You can edit as needed.


1

If you're not going to use InfoPath then you're definitely going to be looking at creating a custom form using HTML and some other custom logic to do the submission for you. The lowest barriers to entry will be JavaScript on the client, or C# in a provider hosted Add-in or server solution. I strongly recommend you consider JavaScript (REST or the JavaScript ...


1

The link you refer has your answer, with only a small tweak, if you are in SP2013. Your url should be as follows: https://yoursite/_layouts/15/Upload.aspx?List={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} Note that 2013 uses /_layouts/15/Upload.aspx, whereas 2010 used /_layouts/Upload.aspx. You can get your library guid by going to the list settings for the ...


1

I'm afraid there is no other way than updating all the htm files. In SharePoint relative paths does not work that way, even if index.htm resides inside the Library.. href='page1.html' would simply mean rootsite/page1.htm Not even the inner site collection will be placed, that means if you have rootsite/sites/innersite/library/page1.htm and you refer it as ...


1

Maybe you can use the BASE tag <head> <base href="[url]"> </head> http://webdesign.tutsplus.com/articles/quick-tip-set-relative-urls-with-the-base-tag--cms-21399 http://stackoverflow.com/questions/1889076/is-it-recommended-to-use-the-base-html-tag


1

Here are the sites you may want to read: CSR - Client Side Rendering The SharePoint 2013 programmers way http://www.viewmaster365.com/#/How Yes you can display HTML/Javascript without the need for CSR, in a Calculated Column How to use Today and Me in Calculated column How to display Today calculations in a View with JavaScript in Calculated Column (or ...


1

I figured it out myself Title Search: <input name="Title" type="text"/> <a onclick="location.href=this.href+Title.value;return false;" href="/sites/203/qaos/bp/Lists/Process%20Tickets/AllItems.aspx?View=&amp;SortField=ID&amp;SortDir=Desc&amp;FilterField1=LinkTitle&amp;FilterValue1="> Image</a>


1

If you're querying a list and outputting the results then I would recommend using the ASP.NET Repeater control/pattern (https://msdn.microsoft.com/en-us/library/zzx23804(v=vs.85).aspx) - essentially the precursor to Razor templating, a Repeater lets you use HTML 'templates' data-bound to a data source. Here's a real-world example from some code I'm writing. ...


1

Using Sharepoint Designer, if I created a HTML page in the root of my site collection, the page opens in the browser as expected. As soon as I dropped it into a document library, it downloads the file. So it looks like you need SharePoint Designer and do not store the files in a document library. This isn't entirely ideal as you lose out on a lot of ...


1

This is because the Browser File Handling option in the Web Application General Settings of SharePoint is set to strict by default. The options are permissive and strict,if you change it to permissive it will work. But unfortunately since you are trying in SharePoint online you cannot do that change. The only option for you is to change the file to .aspx or ...


1

In Office 365, I created a new site (not a personal site). I then opened the site in SharePoint Designer and imported the files into Site Pages. I renamed index.htm to index.aspx I right-clicked on index.aspx and set it as the home page. This works for single html page sites. For multi-page websites you will need to rename all html files to an ...


1

Clicking (4) might be possible with javascript and hooking into events (closing the modal window of the new item form, for example), but clicking (5) is not. You can't control the click action in Outlook using javascript executing in a browser.



Only top voted, non community-wiki answers of a minimum length are eligible