cancel
Showing results for 
Search instead for 
Did you mean: 

Enable and Disable field in logon page

Former Member
0 Kudos

Hi all,

How can I enable and disable a field in the logon page?

I have added a new field called passcode in the logon page of SAP NetWeaver Portal. Initially the passcode field will be disabled for input, when the user enters values in the username and password, I need to enable this passcode field for taking input. Is it possible to achieve this?

Accepted Solutions (0)

Answers (1)

Answers (1)

nol_hendrikx
Active Contributor
0 Kudos

Ofcourse it is possible!

I assume your passcode field has an id, let's say "myPasscode". To make the myPasscode hidden you can use:

 

#myPasscode {

     display: hidden;

}

  

If you entered the two fields (name and password) you can check if the fields are filled in. If so, you can change the visibility with javascript:

 

document.getElementById('myPasscode').style.display = 'block';

Another option is to change the classname from myClassinvisible to myClassvisible.

<input name="passcode" id="myPasscode" class="myClassinvisible"/>

.myClassvisible {

     display: block;

}

.myClassinvisible {

     display: hidden;

}

If you are using jQuery it is even easier!

Former Member
0 Kudos

Hi Noel,

But how can I get to know that username and password fields are filled? Guide me how can I check these values.

Former Member
0 Kudos

Where can I write the code

document.getElementById('myPasscode').style.display = 'block';

in my logon page?

nol_hendrikx
Active Contributor
0 Kudos

You can use the getElementById in a script tag. This executes the script directly, maybe you should make a function to call it.

<script>

     document.getElementById('myPasscode').style.display = 'block';

</script>

Are you familiar with javascript?