Ua rau koj Cov Neeg Tuaj Saib Xyuas Lub Vev Xaib nrog cov ntawv tiag tiag lub sijhawm

hauv internet daim ntawv

The first impression you usually have as a user of a Web Application is when you fill out a web form. I'm amazed at the number of web forms out there that have zero validation or that wait for you to submit your form contents before telling you what problems that you might have.

My rule of thumb is that anything that is not validated is supported. Anything that can be validated prior to submitting the form must be. With the advent of Ajax, you can even validate data against your database prior to submission. Don't pick the lazy route – users appreciate the help!

Ntawm no yog ib co piv txwv:

  1. Email chaw nyob – I don't mind forms that make you fill out your email address twice to validate them, but the fact that they don't tell you whether or not they match or are constructed appropriately is inexcusable.
  2. Cov passwords – If you're going to make me type in a password twice, then please validate that the values are the same before posting the form.
  3. Lo lus zais muaj zog – If you require a certain password strength (combination of alphanumeric characters or cases), then provide some feedback for me while I'm typing my password in. Don't wait for me to submit before telling me it failed.
  4. Hnub – If you'd like the date in a m/d/yyyy format, then allow me to enter the information in a single field by typing those values and formatting them appropriately. If you want leading zeros, put them in after. It's okay to display one format and save another in your database.
  5. Hnub No Yog Hnub Tim - Sau rau kuv! Vim li cas koj thiaj li nug kuv sau rau hnub uas koj twb paub nws lawm ?!
  6. Hnub Tim Hom – If you have an international application, you can default a date format based on Internationalization of your application. Of course, it's good to have an option for users to override that option and select their own.
  7. Lej Xaus Saus – it's pretty simple to add some javascript that automatically jumps from field to field or programmatically put a dash in between values.
  8. Npawb Xov Tooj – taking Internationalization into consideration, these types of fields also can be simplified by formatting the telephone number in the interface, but saving it in another format that's efficient for your back-end. Don't make your users type in parenthesis, spaces, and dashes.
  9. Cov Lus Sau Ntau Ntev – if you limit the number of characters stored in your database, then DON'T let me type that many characters in! It doesn't even require difficult validation… it's just a setting on the textbox.
  10. Yam tsawg kawg nkaus Cov Lus Sau ntev - yog tias koj xav tau qhov tsawg kawg ntawv ntev, tom qab ntawd ua lub suab ceeb toom kom txog thaum kuv muaj cov cim txaus.

Here's an example of a Password Strength function from Geek Txawj Ntse:

Ntaus tus password:

HLOOV TSHIAB: 10/26/2007 - Kuv pom ib qho chaw muaj txiaj ntsig nrog cov ntawv qiv JavaScript tuaj yeem rub tawm rau daim ntawv siv tau, hu ua LiveValidation.

16 Comments

  1. 1

    I agree those are great features for forms, but saying that it is “inexcusable” to not do perform front end javascript validation is a more of an personal opinion. I love working in javascript, and have written some pretty neat editmasks to do some of the things you talk about, but a lot of them are far from trivial, and many of the javascript form validation packages out there have a number of big holes. Not everyone will invest the time into duplicating their back end validation with (more often than not) more complex front end javascript validation.

    Cov ntsiab lus zoo, tab sis meej tsis yog ib qho txhua txhua daim foos online “xav tau” hauv kuv lub tswv yim.

  2. 2

    Tus password xyuas yog relativly tawg. Txhua lo lus zais tau zoo txaus yog tias ntev.

    Piv txwv li:

    Qhov no puas yog qhov nruab nrab lo lus zais?

    f46dffe6ff4ffgdfgfjfgyu656hfdt74tyhdtu5674yfgh6uhhye45herdhrt64684hythdfth54y54348fgdcvzse8cn984v3p4m6vq98476m3wuw89ewfucsd8fg67s4v8tw76u340m6tver7nt+s89346vs+0em9u+s+09hrtuhss586ysvne4896vb4865tbv089rt++

  3. 4

    Rau kuv qhov zoo tshaj plaws daim ntawv validation yog thaum koj muab tus neeg siv lub tswv yim ntawm ib tug neeg sab validation thaum nws yog AJAX / Server sab validation.
    Koj tsuas yog yuav tsum txuas rau koj daim ntawv hais qee qhov kev tshwm sim tuav (keyup, plooj, nyem, thiab lwm yam ...) uas tshaj tawm tag nrho daim ntawv ntawm AJAX mus rau lub server, sau ib qho "check" muaj nuj nqi uas xa rov qab cov lus yuam kev (no passowrd ib yam nkaus yooj yim, hnub ntawd tsis nyob hauv hom tsis ncaj ncees, thiab lwm yam…)
    Thaum tus neeg siv kawg sau daim foos los ntawm nias lub xa khawm, koj tseem tuaj yeem siv "kos" server sab ua haujlwm kom siv tau lub sijhawm kawg ntawm daim foos ua ntej tso cov ntaub ntawv hauv ib qho chaw khaws ntaub ntawv lossis qee cov txheej txheem.
    Txoj kev no, cov neeg siv zoo siab nrog rau thethego validation THIAB cov tsim tawm zoo siab nrog cov neeg rau zaub mov sab tsuas yog kev tsim kho kev tsim nyog.

    • 5
      • 6

        Tsis yog nrawm li Doug - Kuv pom zoo nrog koj qhov kev tsim ua ntej ntawd tias cov txiaj ntsig zoo, xws li ua hom ntawv SSN rau ntawm kev ya yog qhov tsis tseem ceeb. Thiab nws tub nkees kom tsuas tso tawm cov lus uas nws tsis ncaj ncees lawm, thaum koj tuaj yeem kho nws yam tsis tas yuav twv rau hom ntawv.

        Txawm li cas los xij, Kuv tseem pom zoo nrog Nicolas txog kev siv Server Side logic ua ke nrog AJAX.

  4. 7

    Koj lub npe hais tias “Ua rau Koj Cov Phooj Ywg…” tab sis koj tsis ua rau kuv txaus siab nrog 2 feeb, hu xov tooj mus rau.

    Rov qab sau koj lub npe (ua tsis yog lawm, ua rau ib tug xav tias muaj cov piv txwv thiab cov kev coj ua tau sib tham).

    If people are not doing this already in their forms, then they are just learning or the form is not important enough to use validation.

    Tus tsim lub vev xaib tiag paub qhov no twb tau thiab ua nws.

    • 8

      Jay,

      Sorry about that! My point was definitely not to provide developer feedback – I really was coming from the point of view of a Product Manager. I agree with you – but it’s interesting that some other developers don’t! I think that’s unfortunate.

      Ua tsaug rau siv lub sijhawm!
      Doug

  5. 9

    Kuv pom zoo txog ntawm qhov siv tau yog ib qho tseem ceeb ntawm txhua daim ntawv thov. Raws li pab pawg coj, Kuv feem ntau pom kuv tus kheej xa cov cai rov qab mus ua "tiav" rau cov laj thawj xws li tsis muaj kev pom zoo los yog txwv cov ntawv sau cov ntsiab lus ntev.

    Rau feem ntau yam uas kuv ua haujlwm ntawm kuv pom nws yuav siv li 50% ntawm lub sijhawm kom tau txais qee yam ua haujlwm, nyob rau hauv ib txwm mob thiab yog tias cov neeg siv siv cov txheej txheem li kuv xav tau. Lwm 50% ntawm lub sijhawm txhim kho yog los ntawm kev tshuaj xyuas lawv cov kev tawm tswv yim, kom cov ntaub ntawv muaj kev saib xyuas zoo, thiab ua rau daim ntawv foos tsis pub siv cov ntaub ntawv tsis zoo.

    Kuv tau sau ib qho kev tshaj tawm txog yuav ua li cas kuv siv InputVerifiers hauv kuv hava viav vias apps, thiab qhia tias yuav ua li cas kuv txheeb xyuas qhov chaw xa email. Cov lus ib txwm siv uas kuv siv tau yooj yim hloov kho kom haum rau cov xov tooj, zipcodes, SSNs, thiab lwm yam.

    Kuv tus blog ncej yog nyob ntawm http://timarcher.com/?q=node/36

    Zoo sau ntawv Doug!

  6. 10

    Kuv pom zoo ib yam. Lo lus zais yog ib qho tseem ceeb thiab yuav tsum ua tiag tiag. Kuv xav tias nws tsuas yog qhov ib txwm rau yuav luag txhua daim ntawv los ntaus tus password ob zaug, tab sis tsis qhia qhov kev raug cai ntawm ob lo lus zais qhia tau tias nws tsis raug txiav txim siab tiag.

  7. 11

    Kuv pom zoo tias cov neeg siv tau pom zoo tuaj yeem yog tus neeg siv khoom zoo. Txawm li cas los xij, nws tseem ceeb tshaj uas yuav tsum tau ua kom paub tseeb tias cov ntawv txheeb xyuas lawv tus kheej ua rau pom tseeb.

    Koj muab qhov piv txwv ci ntsa iab ntawm qhov kev siv tau tuaj yeem dag ntxias cov neeg siv thiab, zuj zus, tsav lawv ntawm qhov chaw peb:

    Geek Txhab Lus zais lub zog lo lus zais los ntawm kev txiav txim siab tZhKwnUmIss yuav tus password tsis muaj zog. Tsis tsuas yog lo lus zais zoo heev tab sis nws tseem yuav ua rau neeg siv tsis zoo vim tias nws ua rau lawv pom qhov tsis tseeb uas nkag mus rau koj lub xaib siv tus password no yuav yog qhov tsis nyab xeeb.

    Nws yuav zoo dua (thiab yooj yim dua) los qhia cov neeg siv kom paub tias lo lus zais zoo yog tsawg kawg yog rau lub cim ntev thiab yuav tsum muaj ob tus lej thiab cov tsiaj ntawv.

    Lwm cov lus nug siv tau nrog rau cov npe siv uas xav tau qhov ntev tsawg kawg lossis tsis muaj chaw sau cia. Dab tsi yog qhov tsis zoo nrog cov npe X, Yauhas doe, lossis txawm # *! §? Kuv tau lis ntawd.

  8. 12

    Kuv pom zoo nrog koj. Qee cov ntaub ntawv tsis zoo, tab sis nws tsis muaj qhov pom zoo. Cov ntaub ntawv tus kheej tau muab thiab nws tsuas yog tsim nyog los coj nws tiag tiag ib yam li cov ntaub ntawv lag luam hauv cov ntawv luam nyuaj.

  9. 13
  10. 14
  11. 15

    Kuv pom nws txaus luag uas koj tshaj tawm txog lub siab zoo fo providng realtime daim ntawv lees paub thiab tsis tau, koj daim ntawv tawm tswv yim nyob hauv qab ntawm cov ncej muab tsis muaj ntawm no…

    Kuv paub tias koj tab tom siv WordPress los blog koj cov kev xav rau hauv is taws nem, tab sis kev lees paub tias koj xyaum qhov koj tshaj tawm tsis yog lub tswv yim phem tsis zoo ib yam. 🙂

    Cov ncej zoo, los ntawm txoj kev, txawm tias kuv tsis tas yuav pom zoo nrog txhua yam koj tau sau.

    • 16

      Doh! You busted me, Amanda! I do wish I had time to do better form validation and to integrate it into WordPress. I especially like the Adobe Spry validation moj khaum thiab yuav hlub mus pom ib tug neeg muaj ob!

      Thanks! (And I always appreciate that there are multiple opinions on any topic).
      Doug

Yuav ua li cas koj xav hais tias?

Qhov Web site no siv Akismet los txo cov kev pabcuam. Kawm li cas koj cov ntaub ntawv tawm tswv yim tiav.