We help IT Professionals succeed at work.

Passing dynamic(firstname of the ) username and password

saleemkhan asked
Medium Priority
Last Modified: 2013-12-18
hai experts,

i have a html file.when i passthru html its working fine but with static username and password.

Now instead of the static i want who ever enters his username and password has to pass in the html file.
This is the html file

<form  name="TestTicker" action="http://www.abc.com/test/cf/Login.cfm?Action=Login" method=post>
<input type=hidden name="uid" value="user">
<input type=hidden name="testpassword" value="password">
<input type=hidden name="lotus" value="lotus">
<script language="javascript">

 its working fine.

to pass dynamic username and password i done like this.
created a form
<form  name="TestTicker" action="http://abc.com/test/cf/Login.cfm?Action=Login" method=post>

uid:  here i put a text box for computed when composed(formula as username)

password:  here i put a text box for computed when composed(formula as username)

<input type=hidden name="lotus" value="lotus">
<script language="javascript">

now my problem is if give the formula as username i think its passing the firstname and lastname in the html.

so i want to pass only the first name means what ever he type in login page.

how can we do it.
waiting for reply.
Watch Question

Let me repeat what you have said.

From your last line of statement "what ever he type in login page", it infers that,

You have another form which is calling this login form and you want to inherit the values of that previous form into this form, Right !

For that you can use the Form property, "Formulas inherit values from selected document"


In your computed uid field, why not put @Left(User;" "). If the value of User is the first and last name of the person, then putting the @Left will return just the first name.


hai experts,
For the computed field if i gave @username its displaying
saleem khan.
  as per hemanth comment i already tried formulas inherit values from selected document.

As per ur comment @left(user,"").its displaying blank.
  where i am wrong.
any suggestion?

waiting for reply.
If you have set inheritance to the login form , then you should specify the value of the username field to that in the host form, not @username.

As of extracting the first part of the user name use this
@Word("Saleem Khan";" ";1)

Hello saleem,

first of all "ComputedWhenComposed" is wrong setting for HTML forms. Better is "Editable". Even when you set for this form "TestTicker" the option "GenerateHtmlForAllFields" it would not work absolutely correct...

Simple erase this JavaScript "document.TestTicker.submit()" and test around untill you see all html source code in your web browser.

By the way: you @Left formula has not contained the blank for separator. Also @Trim your name to avoid leading blanks.

Good luck,
Application Engineer
The problem is that the values aren't inheriting from the domino login screen, because this form doesn't get saved.
To inherit the name of the current user in your passthru-field do the following :
Add a computed field and call it CurrentUser. The formula is :
@Name([CN]; @UserName)
This field will hold the common name of the logged on user as it is found in your Domino Directory.
To get only the first name, add the @Left command as follows :
@Lef(@Name([CN]; @UserName); " ")
This will return the name left to the first blank. You needn't worry about leading spaces, since the @Name function doesn't return leading spaces.
Now set the Default Value for your passthru field to CurrentUser, so it will get its value from the computed field.

That should give you the first name in the field. To inherit the password that's more complicated. Since you can't inherit it from the field on the login-form, you will have to retrieve this from the Domino Directory. Now here's the catch, the password in your domino Directory is hashed using Notes' encryption. So you can retrieve the encrypted password, but not the regular password. If you can pass this encrypted password as the password to your application there's no problem, if you can't then the user will have to retype his/her password.

The only way to prevent the retyping of the password is to save the password unencrypted somewhere, but this would create a big security issue.

To retrieve the encrypted password use :

As per your comment that @left(user,"") is displaying blank, it's because you need to include the space in between the quotes. So it should look just like this:
@Left(user, " ")


Thanks jerrith for ur comment,

  i need the same help in future.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.