This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 11, 2012, 11:11 AM
15 Posts
topic has been resolvedResolved

How to auto fill a text field?

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role:
  • Tags:
  • Replies: 3
 Hi,
    I have a requirement, which is to fill a text field automatically when type on another text filed. I mean that, let's assume that there are 2 fields called, Employee ID and Username. So what I want to do is, when I type on Employee ID on Employee ID field, it should be filled the Username Field automatically with the same value. System should be shown the changes to the user as it is.   
If you have any solution with this send me a reply as soon as you can. It is pleasure if you send me a code as well. 
 
Thank you. 
Jun 11, 2012, 11:24 AM
126 Posts
Re: How to auto fill a text field?
Depending on your need you could easily use CSJS or SSJS for this.
 
create an onChange event of the Employee ID field with the script:
 
SSJS: 
 
getComponent("username").setValue(getComponent("employeeID").getValue());
 
 
CSJS: 
 
dojo.byId('#{id:userName}').innerHTML      (or  .value)     = dojo.byId('#{id:employeeID}').innerHTML     (or .value)
Jun 12, 2012, 3:12 AM
15 Posts
Re: How to auto fill a text field?
 Hi,
Thank you very much Simon McLoughlin, for your kind considerations. It is working properly as we supposed.
 
Jun 12, 2012, 4:06 PM
15 Posts
Re: How to auto fill a text field?
create an onChange event of the Employee ID field with the script:
 
SSJS: 
 
getComponent("username").setValue(getComponent("employeeID").getValue());
 
 
CSJS: 
 
dojo.byId('#{id:userName}').innerHTML      (or  .value)     = dojo.byId('#{id:employeeID}').innerHTML     (or .value)

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal