Adding button with onclick to SharePoint custom list form. How to pass a value with XSL?
I have a sharePoint custom list form I added a button to. When I select the button it opens a second asp.net page as a popup. the onclick looks like this.
onclientclick="javascript:PS=window.open('https://site/PS.aspx?search={@Name_x0020_x}','PS','width=800,height=600,scrollbars=1');PS.focus()" />
I have a column on the form called @Name_x0020_x and I'd like to pass the value to the popup form using XSL. However the above sends nothing.
Do I need to build a javascript function to get the value of the SharePoint column field and embed that function in the onclick? If so how because I tried and XSL complains about < not being allowed.
Trying this too with no luck:
onclientclick="javascript:PS=window.open('https://site/PS.aspx?search=" '<xsl:value-of select="@Name_x0020_x" /> " ,'PS','width=800,height=600,scrollbars=1');PS.focus()" />
Geting "this web part does not have a valid xs开发者_开发知识库lt stylesheet Error: The character '<' cannot be used in an attribute value.
Thanks.
there is a problem with quotas in your javascript function. Near search=
you are closing double quotes and browser taking <xsl:value-of ...
as stylesheet.
精彩评论