I have to hide the length of the password being entered during login of my asp.net web application. I know the asp.net textbox server control has the textmode of password but I can't even show the that. Any suggestions on how to hide the user input?
<input type="password" name="password" style="color:White;"/>
seems close to your requirement but some browsers highlight input fields with yellow when you are in them. Setting the font size to 1px is another trick you could try.
But easiest might be to instead use z-index to put an image or colored DIV on top of the password field. Maybe an animated gif with a line of * characters that grows and shrinks randomly would be best - would totally confuse onlookers! :-)
How the user even knows the field is selected is another issue you'll have, maybe some extra javascript to detect and tell them that.
If you must (which I agree with #Ando that you shouldn't due to UI issues), I would use javascript (onkeydown) to copy each character to a hidden input field, and remove the key entered in the box.
This would allow you to retrieve the password on postback, while keeping the input field empty for the user.
Of course, if the user presses arrow keys, delete or backspace, you would have to decide how to handle that.
Hiding the length of the input seems like a really really bad UI idea from the users perspective, and you should argue that the specification should be changed.
While, I also agree with everyone else that is a bad idea I understand that some times you have to do things you disagree with.
I would have suggested what Mikael did but he already did it. :)
To recap:
I would use javascript (onkeydown) to
copy each character to a hidden input
field, and remove the key entered in
the box.
This would allow you to retrieve the
password on postback, while keeping
the input field empty for the user.
Of course, if the user presses arrow
keys, delete or backspace, you would
have to decide how to handle that.
You've said:
My issue with using Javascript and
storing in a hidden field is the user
viewing the source of the page and
seeing it.
I'm pretty sure that viewing the source should only show you what was originally downloaded not what the user has entered. However, there are tools (i.e. firefox addons) that can do this. You could store the value in a javascript varible and only put the password in the hidden field when it is posted or use some sore of ajax request to authenticate. However, With the right addons someone could find this as well.
If the issue is someone looking over the shoulder of the person logging in then these concerns (i.e. viewing source) won't matter unless the person who is logging in decides to view the source and show the person in which case it would just be easier for him to tell the other person his password.
Agreeing that its not the best idea...
1) When you start typing, on each key press, restrict a specific character from being entred as part of a password (eg pipe) then when the user types, add a ramdom number of pipes (eg between 0 and 4 pipes) then just remove these server-side?
2) Add these to a hidden field...if the user does a View_Source, they will only see the original value of the field, ie will be empty...just remember to clear the value if you need to depending on how its rendered (asp.net webform hidden field control) etc
3) Have 2 password boxes that need 2 passwords (just as bad an idea)
I confirmed the requirement with a security officer and apparently I miss read the requirement. However, I have seen Windows based applicatiosn perform this. The cursor moves on each key stroke but no star, asterik or bar is used. Thanks to everyone for theie suggestions and comments.
Related
I am making a system to input some paperwork into a digital database.
In said database there are preset Clients, but there are quite a few of them (100+).
That said, when the user has to select a Client, I want to make it as swiftly as possible, and thought of having him start typing the client name, and have a sort of "dropdown" come out of the textbox with a _startsWith filter, and use directional arrows+enter to select. Similar to history on browsers?
Is there anyway to implement such a thing on a Textbox?
Right now I have am filtering a Table with the textbox, and have the user click on the tableRow to select the Client.
Any other ideas are welcome too.
Thank you for reading!
The widget Suggest Box is exactly what you're looking for. See link for documentation.
I have an ASPxTextBox with a NullText. It is used for a user name. Some users are copying their user name from the registration email into this text box. When they do it via right click and the context menu and go back to their email client to copy the password, the text box gets emptied, i. e. NullText is displayed.
I can reproduce this. However, when using Ctrl+V to paste the user name, it is persistent.
It seems to me that the ASPxTextBox is looking for a keydown event or something similar to decide if the text has changed.
How can I make the text persistent in all cases?
It seems that this behavior is a side effect of the browser/form AutoComplete feature.
Can you try to reproduce this issue with a regular with the placeholder attribute (HTML5)?
If the behavior is the same, see this thread.
I am working around this issue with this jquery plugin:
https://github.com/mathiasbynens/jquery-placeholder
I know the very similar question was posted here already (How to change the Text of the browse button in the FileUpload Control (System.Web.UI.WebControls)) and I understand it's not possible to change the description to some custom text, but isn't it at least possible to change it to a different language (e.g. to English)?
I'd like to do it so that my web page is whole in one language (because e.g. "Procházet..." instead of "Browse..." in the middle of English web page looks kind of weird to me).
This is determined at the browser level, unless you moved to something like a flash-based uploader (or <iframe> trickery), you can't customize it. Whatever language/localization the user's browser is in (usually based on the OS setting), that's the language they'll get on the "Browse..." button.
If your page is for consumers likely already in that language, then you're all set, the default behavior works. If people with another language setting come by, well...that's the language they picked, so it should be an intuitive button label, even if it doesn't match.
Although there is direct way to change the Caption of InputFile control,but you can always go for alternative way,
Add InputFile control to you page let's say "fileUpload" and make it Hidden or invisible.
Add new HTMLButton on form with Text Whatever you wanted to give it to your fileupload button (in addition you can also add TextBox too to show uploaded file name when events being gets handle at server side).
Onclick even of above button use below javascript
document.getElementById("fileUpload").click();
It will do the same thing without showing up default InputFile control.
No, it's a matter of client's operating system.
Just wanting to know if anybody has seen an example of a telnet/chat or other console like FLEX application where you can use the same TextArea as input/ouput area.
I've been trying to modify the app at:
http://livedocs.adobe.com/flex/3/html/17_Networking_and_communications_8.html
but so far, computer says no.
All the implementations I've seen use a combination of TextInput and TextArea.
The challenge is that we'll be using this app to telnet into some old routers and we'll need to do a fair amount of copy/pasting. Based on what I've seen, it seems that I would need to point the mouse into the TextInput in order to be able to right click and paste, which is not very sleak.....
Your thoughts,
Fran
edit Just realized that I had trimmed out what was directly pertaining to the question: I was unable to find anything that used the TextArea for input and output; see the below suggestions if custom-component suggestions are ok.
The TextArea component only fires a change event whenever a user adds input. Whenever you set the text field programmatically, a change event does not fire--you could maybe use that as a way to know what is user input and console "responses" by looking for carriage-returns (\r).
I'm unsure if you have a requirement to maintain the user's input at the bottom-most line (like a console), even after the console responds with something like auto-complete. If that's the case, then something a bit more complex would have to come into play (such as remembering where the user's input started/ended) or the requirement of a single-component console needs to be reconsidered--sleek is nice, but not always necessary.
I want to create a combobox in flex which will take three values, Available, Unavailable, and Busy. The constraint is, I should not allow user to go directly from Unavailable to Busy. So when a User is selected Unavailable, I should keep the Busy item disabled (unselectable), but a user will be able to go directly from Available to Busy. I chouldn't find a straight forward way to disable an item in combobox in Flex. How can I do that?
Have you considered using radio buttons rather than a combo box? It's clear how to do this for radio buttons, for one thing. Also, it can often be friendlier to present the available options without requiring a click to reveal them. (Especially if, as in this case, you are adding the possibility that an option is "available, but not possible for you right now for some reason not shown in this combo-box item").
If you really want a combo-box, you can use the click event to display it in a non-standard fashion by probably changing its style; and then, if clicked anyway, Then, in the selected event, reject the choice (hopefully with an indication of why),
Or, if you want to simply remove it from the list, you can have the click listener event repopulate the source list each time, based on conditions. But that might be confusing to the user, too.
You can also have a look at
www.stoimen.com/blog/2009/03/05/flex-3-combobox-disabled-options/
which references
wmcai.blog.163.com/blog/static/4802420088945053961/
(note for NoScript users you must have 163.com and 126.com at least temporarily allowed to be
able to properly see this page)
it works very well even though I added the code for being able to properly handle keyboard
events in the dropdown list
Full self working example available at
http://olivierbourdon.homedns.org/OpenSource/combos.zip
Thanks again for the good work