Pre fill the password field - drupal-6

I want to pre-fill the password field from the Cookie. I am setting #value, but it is not rendered. I have also tried #default_value. Is there any way to do this?

The password textfield doesn't use #default_value, as reported in Form API reference.
You should implement your own form field, to pre-fill the password textfield. I am not sure if browsers would permit a password textfield to be pre-filled, though.

Related

Problems with elements injected into HTML from user travel

when I set the ContentDefinitionReferenceId = "api.signuporsignin"
the login screen is shown with the elements sing up now
and forgot password
but among the html elements there is no select with the document type list that I have added. image here
enter image description here
Now when I change the ContentDefinitionReferenceId = "api.selfasserted" now if the list of document types is shown but there is no sign in button, sing Up now, forget the password.Image here
enter image description here
When using combined sign in and sign up, you cannot add more fields to the sign in page. The observation that it breaks the formatting is expected when attempting to do so.
https://learn.microsoft.com/en-gb/azure/active-directory-b2c/self-asserted-technical-profile#output-claims-sign-up-or-sign-in-page
When using selfAsserted, you can add more fields.
If you need more fields, this will be the only option. You will lose the sign up and forgot password links, you’ll have to add your own links if needed which go via your app to a separate B2C policy.

is it possible to force input type="password" to be treated as type="text"?

When I'm visiting a webpage with password fields, I want to make the password field visible. I'm looking at somebody else's page, so I can't (e.g.) change the type= attribute of the input field, nor can I insert javascript into the page (to do the same thing).
Can I somehow override the -webkit-text-security attribute to force the field to display?
If you are thinking what I think you are...
Simply right click on the password field and select inspect element. Change input type="password" to input type="text", and whatever you typed in the password field (which was displayed as hidden characters) is then displayed as plain text.

How can display a text and clear form when it was submitted in Kentico?

I need when a user submit a form this will be clear and display a text.
Hi, can it be possible? Thanks
In the general settings for the Form you can do either Clear Form or Display Text, not both.
If you need both, I would suggest maybe redirecting to a URL, have the URL the same as the form, but with a querystring added, then on page load check for the querystring value and display the message if it exists. Otherwise you will have to edit the web part.
Keep in mind if you go the QueryString route, if they submit the form and get a validation error, your logic for displaying the message if the QueryString value exists will have to handle this, otherwise you are going to keep displaying it when it wasn't a success.
The easiest route would probably be just display a message with a link to reload the form.

When hand-coding CodedUI Tests, is there a way to clear text inputs before populating them?

My goal is to clear text inputs before populating them.
For example, I am populating form fields using:
Keyboard.SendKeys(myInput, "Some Text");
My form populates fields on page load using cookie values.
When I try to use CodedUI to populate the email field, it appends a string to the current value instead of adding the desired value only.
My goal is to use CodedUI to populate the email field with:
foo#bar.com
But, since the field is already aaa#bbb.com (populated with cookie data on page load), it ends up being:
aaa#bbb.comfoo#bar.com
This worked. Set the text property before sending keys:
myInput.Text = "";
Keyboard.SendKeys(myInput, "Some Text");
You could try to double click the field to select all text, when the text is selected it will be overwritten.
Mouse.DoubleClick(myInput)
Maybe better is to clear the cookies before each test run
BrowserWindow.ClearCookies()
I've used the following with success:
control.SetFocus();
Keyboard.SendKeys("a", System.Windows.Input.ModifierKeys.Control);
Keyboard.SendKeys("{Delete}");
Keyboard.SendKeys(control, value);

show and hide Span/Label text in textbox

I am trying to implement a simple trick which would hide span/label inside textbox when user starts entering text in respective textbox, and show it, on blur if textbox is empty.
(It is implemented on user sign in form)
This thing is working okay so far and here is the demo
But it fails in following scenario:
1) If user enters username, previously entered username list (the form data stored by browser when auto-complete is turned off) appears. And if user selects username with mouse-click from the list, password field gets auto-populated. Now though password field has value in it, it won't hide the span.
(keydown/focus/click/change event over textbox not helping in this case)
2) When the username/password is wrong, page reloads, username textbox has last entered value. But still the span over it is being displayed.
(I tried to check if username textbox is empty on pageload. It didn't work)
Can anyone help me fix these things?
Thanks in advance... :)
What you need i s a placholder. Placeholder have been standardized by html5
and can be easily implemented via various jquery plugin (here is one).
i suggest you use those solutions, as they are standards. the ideal solution is to use html5 and than fallback to javascript for older browsers.
Look ath this form where i implemented placholders: http://www.consiglio.regione.lombardia.it/web/crl/BancheDati/atti_si
When you insert a letter in an input field, the text disappears. It's done with the help of that plugin.
It seems that you are attempting to reinvent the wheel here. Check this already answered question on what appears to be the same subject:
how do I make an html text box show a hint when empty
Usability-wise, I don't think it would be terrible to hide the watermarks of both inputs regardless of which on was clicked/keydowned etc. Now this next option is controversial, so you have been warned...
<input name="first_name" type="text" autocomplete="off">
Just wanted to make sure you were aware of that - most often used to prevent credit card fields from autocompleting. Hope something in here this helps.

Resources