Difference between revisions of "Updateable Web Page View Fields"

From SmartWiki
Jump to: navigation, search
Line 34: Line 34:
 
==Displaying Checkbox field==
 
==Displaying Checkbox field==
  
To display a Checkbox inside an updateable webpage view field use the following syntax:
+
To display a Checkbox inside an updateable webpage view field use the following syntax:
  
  '''<input type="checkbox" name='obj.cf_fieldid' value="value of field" @checkbox('fieldid','value of field')@>'''
+
<input type=hidden value="" name='obj.cf_fieldid'>
 +
<input type='checkbox' onclick="onlyonechecked(this)" name='obj.cf_fieldid' value='value of field' @checkbox('fieldid','value of field')@>
  
  Example: '''<tr><td><input type="checkbox" name='obj.cf_1139865' value="Financial" @checkbox('1139865','Financial')@>Financial</td></tr>'''
+
*You must include a hidden object with the same name as the check box object, directly prior to the checkbox object.
 +
 +
Example:  
 +
<tr><td><input type=hidden value="" name='obj.cf_12345'>
 +
    <input type='checkbox' onclick="onlyonechecked(this)" name='obj.cf_12345' value='Financial' @checkbox('12345','Financial')@>Financial
 +
  </td></tr>'''
  
  
It is also possible to [[Changing the Status from a Web Page View|Change the Status from the Web Page View]].
+
 
 +
 
 +
 
 +
==See Also==
 +
* [[Changing the Status from a Web Page View]
 +
 
  
 
[[Category:System Management]][[Category:Custom Fields]][[Category:JavaScript Examples]]
 
[[Category:System Management]][[Category:Custom Fields]][[Category:JavaScript Examples]]

Revision as of 16:10, 8 June 2009

Overview

This code can be used in the field type of 'Web page view' to allow for user to enter data into the form which will be 
updated on their records on the system. Currently this function is only available for the custom fields and not the standard
fields. Following sample code is the format in which this web page view should be in order to be accessible by the user.

Sample Code

<html>
<body>
[@formstart@]
[@formsubmitpage=page_wil_be_redirected_after_save@]


<input type=text name='obj.fd_name' value="@name@">
<p>
<input type=text name='obj.cf_18168' value="@#18168#@">
<input type=submit value="Save">
[@formend@]

</body>
</html>

Breakdown of the syntax

[@formstart@] : Mandatory, indicates start of a updatable form, only one form can be exist on a web page field
[@formsubmitpage=page_wil_be_redirected_after_save@] : Optional, what page will be redirected after save, stays on the same age if this tag is missing. Typically, a confirmation page on smartfolder will be used.
[@formend@] : Mandatory, indicates end of a updatable form.
<input type=text name='obj.fd_name' value="@name@"> or <input type=text name='obj.cf_18168' value="@#18168#@">

The @name@ and @#18168#@ are just typical web page view variable syntax, this will prepopulate the existing values into the field. The obj.fd_name and obj.cf_18168 instructs which field to store the value in. Standard fileds starts with obj.fd_ while custom fileds starts with obj.cf_. For the custom fields use the field id number to address the field.

Displaying Checkbox field

To display a Checkbox inside an updateable webpage view field use the following syntax:

<input type=hidden value="" name='obj.cf_fieldid'>
<input type='checkbox' onclick="onlyonechecked(this)" name='obj.cf_fieldid' value='value of field' @checkbox('fieldid','value of field')@>
  • You must include a hidden object with the same name as the check box object, directly prior to the checkbox object.

Example:

<tr><td><input type=hidden value="" name='obj.cf_12345'>
   <input type='checkbox' onclick="onlyonechecked(this)" name='obj.cf_12345' value='Financial' @checkbox('12345','Financial')@>Financial
 </td></tr>



See Also

  • [[Changing the Status from a Web Page View]