Wednesday, 1 December 2010

WSS: Developing custom form, passing and populate field by querystring

Example: Javascript example by Marc D Anderson of populating fields by querystring
http://sympmarc.com/2008/07/11/using-query-string-variables-to-populate-sharepoint-form-fields/


Code: Getting the querystring parameter using XSL
In the DVWP, you can bind a parameter to the querystring:


<ParameterBindings>
<ParameterBinding Name="ListID" Location="QueryString(ListID)" DefaultValue=""/>
ParameterBindings>
Then call the parameter in the xsl stylesheet:

<xsl:param name="ListID" />
Then you can filter the node set by the parameter:

<xsl:variable name="Rows" select="dsQueryResponse/Rows/Row[@ListID=$ListID]"/>

Resource: Understanding SharePoint's ddwrtdatabind
http://www.bryancook.net/2009/09/understanding-sharepoints-ddwrtdatabind.html

Example: Setting form fields using querystring, step by step guide to create a custom form by Mark Rackley
http://www.endusersharepoint.com/2009/11/03/setting-sharepoint-form-fields-using-query-string-variables-without-using-javascript/

Resource: ASP.NET Form Textbox Validation
http://www.asp101.com/lessons/validation.asp

Resource: Custom form Validation
http://www.4guysfromrolla.com/articles/073102-1.aspx

Code: Submit Button, set page/redirecturl after form submission
You can put any URL insde the redirect curly braces without quotes.
http://www.go4answers.com/Example/solution-controlling-redirect-url-65469.aspx

<input name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={}')}" type="button" value="Save" />

No comments: