~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/shortName.js

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// -----------------------------------------------------------------------------
 
3
// $Id: shortName.js 1251 2006-01-31 06:43:27Z torgeilo $
 
4
// -----------------------------------------------------------------------------
 
5
 
 
6
function nameChanged()
 
7
{
 
8
    var nameField = document.getElementById( 'name' );
 
9
    var shortNameField = document.getElementById( 'shortName' );
 
10
    var maxLength = parseInt( shortNameField.maxLength );
 
11
    
 
12
    if ( previousName != nameField.value
 
13
        && nameField.value.length <= maxLength
 
14
        && ( shortNameField.value == previousName
 
15
          || shortNameField.value.length == 0 ))
 
16
    {
 
17
            shortNameField.value = nameField.value;
 
18
    }
 
19
    
 
20
    previousName = nameField.value;
 
21
}