How did this form know that I used autocomplete? - javascript

I signed up for a free account at 96Down.com using Chrome, which auto-filled some of the fields for me (last name and email address).
When I submitted the form, those fields were highlighted asking me to make sure I fill out those fields. Were they somehow able to detect that I didn't manually fill in these fields?
I must admit I haven't had time to look at their code, I was just wondering if anyone already knows of this.

They could keep a boolean for each field and set it to true if the field got focus. That way they'd know if autocomplete was used (if any of those booleans are still false, autocomplete must have been used).
There may be other techniques - why don't you look at the source of 96Down.com and enlighten us?

96down.com uses the amember script, if you need more info on it just visit http://www.amember.com/
Aled

Related

Do I need JavaScript Form validation?

I'm working on some forms for a Website. Currently I have the usual HTML Browser check (with "required"-tag and patterns and stuff in the inputs), I check the values in a JavaScript before submitting and I do a server-sided check of the data after submitting.
Everything works fine, even if I have only one of them enabled, but it seems a little bit overkill to me, so my question is if I can just leave the Javascript check out? Of course I need to keep the server chek :D
Looking forward to your answers!
You must always validate input at serverside. Javascript is optional and it just to make life of your users easier. Your users get better experience. That's it.
All modern browsers support the HTML5 form field attributes. As you are using those, you may skip the JS validation.
To expand a little on the current answers:
Server side validation is always required, you mentioned that.
HTML and Javascript validation are used for different things.
The HTML required tag can be used to check a form's fields are not blank before a form submission.
Javascript validation allows you to be far more flexible with what you want to validate and when. However, it requires more work because it's not as simple as a required tag.
With Javascript you can do far more. Some examples:
Validation that occurs as soon as a user starts to type
Have the box highlight a different colour
Show an error message
Have a big red cross appear next to invalid fields or a big green one next to valid ones
Spin your page around when the user enters something invalid. (don't actually do that)
etc.
Also note browser support for the required tag.

Input Box Text Grouping Style

I'm wanting to write a a block style input text box. I realized I might not be describing it correctly and if someone could give me the proper name, I would appreciate it. Basically I want the functionality of how GMail uses their email address client:
I don't need the autocorrect functionality, just the part where a user presses the enter key and it places it in a single entity/block and you can continue to type.
I'm sure there are libraries out there but I've had trouble finding them since I don't know what the technical name for them are. Any examples would be appreciated!

Add a template to an input field

This is for an application using AngularJS (if it matters).
I'm looking for a way to add some sort of a "template" to a HTML input field, much like a placeholder. See, I have this date-field, in which the user can type the date, or he can use a datepicker to select the date.
I currently have an HTML input field with a placeholder: "dd/MM/yyyy", which shows the format in which the date should be entered. now what I would like is a kind of placeholder that stays while the user types - and possibly even limits the users options (for instance: only numbers are allowed, nothing else is possible).
Ideally, the placeholder should stay while the user types so he can see what the format is while he is typing. The user should (if possible) also be restricted from typing any not allowed characters.
Does anyone know of any already-existing solutions to this use case? I've been searching for a while now but don't seem to be using the right words ...
Addition: I know I still have to check the user's input server side. I'm not relying on JS for the validation of the date.
You can look at this: http://forza.ndevrstudios.com/#/form-masks
It's done with latest angular-ui (http://angular-ui.github.io/ui-utils/) and something like this in your input field:
ui-mask="99/99/9999" model-view-value="true"

Crm field control order Javascript

I would like to change the order in which the fields in a form get checked.
The field Email should be checked before the field City. They are both obligatory.
I would also like that when the email address is invalid only one Popup is shown (by default I get two- one saying the email is invalid and one saying that the field cannot be null)
Is it possible to change the order of the checks and do the custom checks before the system ones?
Marco
The only supported method of changing the order in which the fields get checked, is changing the order on the form. I'm assuming that CRM just loops through it's collection of controls to perform the field validations. You could attempt to dive into the CRM javascript and figure out a method to hijack it.
A supported way of handling it would be to make the fields not required (either via javascript on the OnLoad, or updating the entity definition itself), and then on the OnSave, writing your own field validation. It's a lot of extra work, and you lose the little red asterisk showing the field is required, but you'd be able to evaluate them in the order you'd like (or display a single message with everything that's missing (why that isn't done by default in CRM I'll never know)), and be able to fix your email invalid / not null message.
CRM does not loop through its collection of controls as specified in the answer above.
The validation of the fields(business required) on a CRM form happen in the order in which they were added to the form, irrespective of where they are placed in the form. So, as of now, the only way to change the order in which they are validated is to add them in the same order as you want them validated.
So far.. I believe the only option to work around this is stated in this link.
http://social.microsoft.com/Forums/en-US/8f402463-23aa-4bc1-862b-4f4093a0cce8/required-fields-order-of-validation?forum=crmdevelopment
Basically you would need to use javascript. Have only one field as mandatory. On change of this field set the next field (in the correct order) to mandatory and so on.. hectic but only way.

Is it possible to access text input's history with javascript?

Firefox remembers what you have so far entered in a given text input and as soon as you start typing it suggests previous values matching what you have typed so far.
Is it possible to access this list via javascript?
Thanks.
Firefox remembers what you have so far
entered in a given text input and as
soon as you start typing it suggests
previous values matching what you have
typed so far.
This features is there with the browser itself.
Is it possible to access this list via
javascript?
I am afraid, that's not possible
No that is not possible, that information is private to the user.
If it was possible, you could just put a textbox with the name "email" or "password" on a page, and start harvesting whatever people wrote in such textboxes on other sites.
Even if you limit the access to the same site, people doesn't always want to be associated with what they did earlier. If I for example accidentally made a search for something that happens to be urban slang for something else, I don't want "relevant ads" to follow me.

Categories