Difference between revisions of "Custom Field Type: Special – Browser Script"
From SmartWiki
Julia Decker (talk | contribs) |
Andy Nguyen (talk | contribs) |
||
Line 36: | Line 36: | ||
* '''Style''': N/A | * '''Style''': N/A | ||
* '''Tool Tip''': N/A | * '''Tool Tip''': N/A | ||
+ | |||
+ | <u>'''Example'''</u> | ||
+ | Setting End Date to current date as long as the status is not equal to Close | ||
+ | |||
+ | if ([status] != 'Closed') | ||
+ | { | ||
+ | var t=new Date(); | ||
+ | var year = t.getFullYear(); | ||
+ | var mon = t.getMonth() + 1; | ||
+ | var day = t.getDate(); | ||
+ | |||
+ | document.form1.enddate.value=year+'-'+mon+'-'+day; | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | |||
[[Category:Custom Fields]] | [[Category:Custom Fields]] |
Revision as of 17:01, 17 October 2007
Field Display
This type of field is not displayed.
General Description
- This field type adds a JavaScript to the page on which it is located.
- This script will execute whenever the page is saved.
- This field type is used by programmers to create enhanced functionality.
- The field is not displayed.
Field Options
- Allow Empty: N/A
- Default Text: N/A
- Options: N/A
- Track Changes: Yes
- Store To Value: N/A
Special Options for Field
JavaScript – stores the procedure you wish to execute.
Field Validation
- Type: N/A
- JavaScript Validation: N/A
- Message: N/A
- HTML Tag: N/A
Field Formatting Options
- Height: N/A Measure: Default:
- Width: N/A Measure: Default:
- Number Format: N/A
- Style: N/A
- Tool Tip: N/A
Example Setting End Date to current date as long as the status is not equal to Close
if ([status] != 'Closed') { var t=new Date(); var year = t.getFullYear(); var mon = t.getMonth() + 1; var day = t.getDate();
document.form1.enddate.value=year+'-'+mon+'-'+day;
}