My Techie Blog

  Home  |   Contact  |   Syndication    |   Login
  110 Posts | 5 Stories | 406 Comments | 0 Trackbacks

News

Article Categories

Archives

Post Categories

ADO.NET

Ajax

API/WebServices

ASP.NET Resources

BizTalk Server

Blogs I read

Free Books

How to

iOT

JavaScript

JQuery

JSLink - SharePoint

JSON

LINQ

Misc

Mobile BI

MS Business Inteliigence

Reporting Services

Responsive/MVC ASP.NET

SEO

Sharepoint Resources/Tools

SharePoint 2010 Branding

SharePoint 2010 Videos

SharePoint 2013

SharePoint Online

SilverLight

SPServices

SQL Server

Sql Server 2012

SSIS

Web Optimization Tools

Web Performace Tools

Windows 8

Windows Azure

Windows Azure

Windows Phone

WorkFlows

WSS V3

xml

I was working on a a DWP using Sharepoint Designer and i wanted to get the value of a node using Jquery
So i added a <div id="myid"></div>

and then on the client did some $(div#miyd)
But what i noticed is that anytime i save my page in Sharepoint Designer and open it up again my div id changes to

<div id="myid{generate-id()}"></div>
So i came across some solution from Marcs Blog here which suggested you add a variable like so
<xsl:variable name="myid/>
and then use it later like this
<div id="myid"></div> but this didn't work.
So the solution was to add the magic expression like this <div id="{myid}"></div>
And that worked like a charm
 

posted on Friday, August 20, 2010 2:36 AM

Feedback

# re: How to Remove {generate-id()} from a Customized Form in SharePoint or in a Dataview Webpart 10/31/2012 4:30 PM Chinh Tran
The solution <div id="{myID}" does not work for me.
This will work for sure: <div id=myid{''} />. The '' is an empty string.

# re: How to Remove {generate-id()} from a Customized Form in SharePoint or in a Dataview Webpart 10/31/2012 4:31 PM Chinh Tran
The solution <div id="{myID}" does not work for me.
This will work for sure: <div id="myid{''}" />. The '' is an empty string.

# re: How to Remove {generate-id()} from a Customized Form in SharePoint or in a Dataview Webpart 10/19/2016 11:46 PM LQd
Thanks Chinh Tran! This is the simplest solution I came across and works for me.

Post A Comment
Title:
Name:
Email:
Comment:
Verification: