Difference between revisions of "Custom Field Type: Special – Browser Script"
From SmartWiki
Andy Nguyen (talk | contribs) |
Andy Nguyen (talk | contribs) |
||
Line 38: | Line 38: | ||
<u>'''Example'''</u> | <u>'''Example'''</u> | ||
+ | |||
Setting End Date to current date as long as the status is not equal to Close | Setting End Date to current date as long as the status is not equal to Close | ||
Line 43: | Line 44: | ||
{ | { | ||
var t=new Date(); | var t=new Date(); | ||
+ | |||
var year = t.getFullYear(); | var year = t.getFullYear(); | ||
+ | |||
var mon = t.getMonth() + 1; | var mon = t.getMonth() + 1; | ||
+ | |||
var day = t.getDate(); | var day = t.getDate(); | ||
Revision as of 17:02, 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;
}