Ne èdi faɛl ƒe nyawo tsɔtsɔ de eme la, trɔ asi le .form-controlna .form-control-file.
Sizing ƒe lolome
Ðo kɔkɔƒewo to klasswo abe .form-control-lgkple .form-control-sm.
Nuxexlẽ ɖeɖeko
Tsɔ readonlyboolean nɔnɔme kpe ɖe nyawo tsɔtsɔ de eme ŋu be nàxe mɔ ɖe nyawo tsɔtsɔ de eme ƒe asixɔxɔ ƒe tɔtrɔ nu. Nuxexlẽ ɖeɖeko ƒe nyawo dzena le bɔbɔe wu (abe nyawo tsɔtsɔ de nuwɔametɔwoe ene), gake lé fli si wozãna ɖaa la ɖe asi.
Nuŋɔŋlɔ gbadzaa koe xexlẽ
Ne èdi be woawɔ <input readonly>nusiwo le wò nuŋlɔɖigbalẽvia me ƒe atsyã abe nuŋɔŋlɔ gbadzaa ene la, zã .form-control-plaintextklass la nàtsɔ aɖe nɔnɔmetata ƒe akpa ƒe nɔnɔme si woɖo ɖi la ɖa eye nàkpɔ axadzinuŋɔŋlɔ kple padding si sɔ la ta.
Range ƒe Nyatakakawo
Ðo range inputs siwo woate ŋu aʋu le tsia dzi to .form-control-range.
Dzesiɖakawo kple radiowo
Wowɔa dzesideɖaka kple radio siwo woɖo ɖi la wònyona ɖe edzi to kpekpeɖeŋu nana .form-check, klass ɖeka na nyawo tsɔtsɔ de eme ƒomevi eveawo siaa si naa woƒe HTML akpawo ƒe ɖoɖo kple nuwɔna nyona ɖe edzi . Aɖakawo nye tiatia ɖeka alo geɖe tiatia le xexlẽdzesi aɖe me, gake radiowo ya nye tiatia ɖeka tso geɖe me.
Wodoa alɔ dzesiɖaka kple radio siwo wowɔ nuwɔametɔwoe, gake be nàna not-alloweddzesi le dzila ƒe hover dzi la <label>, ahiã be nàtsɔ disablednɔnɔmea akpe ɖe .form-check-input. Nɔnɔme si wowɔ nuwɔametɔe la awɔ amadede si me kɔ wu ŋudɔ be wòakpe ɖe eŋu wòafia nusi wotsɔ de eme ƒe nɔnɔme.
Wotu dzesideɖakawo kple radiowo zazã be woado alɔ agbalẽvi ƒe kpeɖodzinana si wotu ɖe HTML dzi eye woana dzeside siwo le kpuie, siwo ŋu woate ŋu aɖo. Esi wòle alea ta la, míaƒe <input>s kple <label>s nye nɔviwo ƒe akpa siwo to vovo na an <input>within a <label>. Esia nye nyagbɔgblɔ geɖe wu vie abe alesi wòle be nàgblɔ idkple fornɔnɔmewo be nàtsɔ asɔ <input>kple kple <label>.
Default (woƒo ƒu ɖe wo nɔewo dzi) .
Le gɔmedzedzea me la, woaɖo dzesiɖaka kple radio xexlẽme ɖesiaɖe si nye nɔvi kplikplikpli la ɖe wo nɔewo dzi le tsitrenu eye woatsɔ .form-check.
Le fli me
Ƒo dzesiɖakawo alo radiowo nu ƒu ɖe fli ɖeka si le tsia dzi la dzi to wo tsɔtsɔ kpe .form-check-inlineɖe ɖesiaɖe .form-checkŋu me.
Nuŋlɔɖiwo manɔmee
Tsɔ kpe .position-staticɖe nyawo tsɔtsɔ de eme .form-checksiwo me label nuŋɔŋlɔ aɖeke mele o ŋu. Ðo ŋku edzi nàgatsɔ dzesideŋkɔ ƒomevi aɖe ana mɔ̃ɖaŋununya siwo kpena ɖe ame ŋu (le kpɔɖeŋu me, zazã aria-label).
Nɔnɔme
Esi Bootstrap wɔa dɔ display: blockeye wòzãa width: 100%míaƒe agbalẽviwo ƒe dziɖuɖuwo katã kloe ta la, agbalẽviwo aƒo ƒu ɖe tsitrenu le gɔmedzedzea me. Woateŋu azã klass bubuwo atsɔ atrɔ asi le ɖoɖo sia ŋu le agbalẽvi ɖesiaɖe nu.
Ðo ƒuƒoƒowo ɖe ɖoɖo nu
Klas .form-grouplae nye mɔ bɔbɔetɔ kekeake si dzi woato atsɔ ɖoɖo aɖewo akpe ɖe agbalẽviwo ŋu. Enaa klass si te ŋu trɔna ɖe nɔnɔmewo ŋu si dea dzesiwo, dziɖuɖuwo, kpekpeɖeŋu nuŋɔŋlɔ siwo woate ŋu atia, kple gbedasiwo ƒe kpeɖodzinana ƒe gbedasiwo ƒe ƒuƒoƒo nyuie ƒe dzi ƒo. By default it only applies margin-bottom, gake efɔa atsyã bubuwo ɖe eme .form-inlinene ehiã. Zãe kple <fieldset>s, <div>s, alo nu bubu ɖesiaɖe kloe.
Àteŋu aɖɔli hã .rowna .form-row, míaƒe grid fli si wozãna ɖaa ƒe tɔtrɔ si tsia sɔti ƒe tsiɖɔɖɔɖɔƒe siwo woɖo ɖi la ɖa hena ɖoɖo siwo le sesẽm wu eye wole sue wu.
Woateŋu awɔ ɖoɖo siwo sesẽ wu hã kple grid ɖoɖoa.
Nɔnɔme si le tsia dzi
Wɔ nuŋlɔɖi siwo le tsia dzi kple grid la to .rowklass la tsɔtsɔ kpe ɖe ƒuƒoƒo ƒuƒoƒowo ŋu kple .col-*-*klassawo zazã atsɔ agblɔ wò dzesiwo kple dziɖuɖuwo ƒe kekeme. Kpɔ egbɔ be yetsɔ kpe .col-form-labelɖe wò <label>s hã ŋu ale be woanɔ titina le tsitrenu kple woƒe nuŋlɔɖi ƒe dziɖuɖu siwo do ƒome kplii.
Ɣeaɖewoɣi la, ɖewohĩ ahiã be nàzã margin alo padding utilities atsɔ awɔ alignment deblibo ma si nèhiã. Le kpɔɖeŋu me, míeɖe padding-tople míaƒe radio inputs ƒe dzeside si woƒo ƒu ɖe wo nɔewo dzi la ɖa be míawɔ nuŋɔŋlɔa ƒe gɔmedzedze nyuie wu.
Horizontal agbalẽvi ƒe dzeside ƒe lolome
Kpɔ egbɔ be yezã .col-form-label-smalo .col-form-label-lgna wò <label>s alo <legend>s be nàwɔ ɖe kple ƒe lolome dzi .form-control-lgnyuie .form-control-sm.
Sɔtiwo ƒe lolome ɖoɖo
.colAbe alesi woɖee fia le kpɔɖeŋu siwo do ŋgɔ me ene la, míaƒe grid ɖoɖoa na be nàte ŋu atsɔ s xexlẽme ɖesiaɖe ade a .rowalo .form-row. Woama kekeme si li la ɖe wo dome sɔsɔe. Àteŋu atia wò sɔtiwo ƒe akpa sue aɖe hã be wòaxɔ teƒe geɖe alo sue aɖe, esime .cols susɔeawo ma susɔeawo sɔsɔe, kple sɔtiwo ƒe hatsotso tɔxɛwo abe .col-7.
Auto-sizing ƒe lolome
Kpɔɖeŋu si le ete zãa flexbox dɔwɔnu tsɔ ɖoa emenyawo titina le tsitrenu eye wòtrɔna .colɖe eŋu .col-autoale be wò sɔtiwo naxɔ teƒe geɖe ko alesi wòhiã. Ne míagblɔe bubui la, sɔtiawo ƒe lolome nɔa te ɖe emenyawo dzi.
Emegbe àteŋu agbugbɔ atsaka ema ake kple sɔti ƒe klass siwo ƒe lolome le koŋ.
Zã .form-inlineklass la nàtsɔ aɖe dzesiwo, nuŋlɔɖiwo dzi kpɔkpɔ, kple abɔta siwo kplɔ wo nɔewo ɖo afia le fli ɖeka si le tsia dzi dzi. Agbalẽvi dzi kpɔkpɔ le agbalẽvi siwo le fli me me to vovo vie tso woƒe nɔnɔme gbãtɔwo gbɔ.
Controls are display: flex, collapsing any HTML white space eye wòɖe mɔ na wò be nàna alignment control kple dometsotso kple flexbox utilities.
Dziɖuɖuwo kple nyawo tsɔtsɔ de eme ƒe ƒuƒoƒowo xɔa width: autobe woaɖe asi le Bootstrap ƒe gɔmedzedze width: 100%ŋu .
Ðeko dziɖunuwo dzena le fli me le nukpɔkpɔ siwo keke 576px ya teti me be woatsɔ abu akɔnta le nukpɔkpɔ gbadza siwo le asitelefonwo dzi ŋu.
Ðewohĩ ahiã be nàtsɔ asi akpɔ agbalẽvi ɖekaɖekawo dzi kpɔkpɔ ƒe kekeme kple woƒe sɔsɔme gbɔ kple dometsotso ƒe dɔwɔnuwo (abe alesi woɖee fia le ete ene). Mlɔeba la, kpɔ egbɔ be yede <label>agbalẽvi ɖesiaɖe dzi ɣesiaɣi, ne ehiã be yeaɣlae ɖe amedzro siwo menye screenreader o kple .sr-only.
Kpekpeɖeŋunamɔ̃wo abe screen readers ene akpɔ kuxi le wò agbalẽviwo ŋu ne mède dzesidenu ɖesiaɖe si nèŋlɔ la ŋu o. Le agbalẽvi siawo siwo le fli me gome la, àte ŋu aɣla dzesideawo to .sr-onlyklass la zazã me. Mɔnu bubuwo li siwo dzi woato ana dzeside na mɔ̃ɖaŋununya siwo kpena ɖe ame ŋu, abe aria-label, aria-labelledbyalo titlenɔnɔme ene. Ne esiawo dometɔ aɖeke mele eme o la, kpekpeɖeŋunamɔ̃wo ate ŋu azã placeholdernɔnɔmea, ne ele eme, gake de dzesii be placeholderwomeɖo aɖaŋu be woazãe atsɔ aɖo dzesidemɔnu bubuwo teƒe o.
Kpekpeɖeŋu nuŋɔŋlɔ
Woateŋu awɔ kpekpeɖeŋu nuŋɔŋlɔ si le agbalẽviwo me le mɔxenu ƒe ɖoɖo nu to .form-text(si woyɔna tsã be .help-blockle v3 me) zazã me. Woateŋu awɔ kpekpeɖeŋu nuŋɔŋlɔ si le fli me ŋudɔ le mɔ si trɔna nu to HTML ƒe akpa ɖesiaɖe si le fli me kple dɔwɔnu ƒe hatsotsowo abe .text-muted.
Kpekpeɖeŋu nuŋɔŋlɔa tsɔtsɔ do ƒome kple agbalẽvi dzi kpɔkpɔwo
Ele be kpekpeɖeŋunuŋɔŋlɔ nado ƒome tẽ kple nuŋlɔɖi ƒe dziɖuɖu si wòku ɖe aria-describedbynɔnɔmea zazã ŋu. Esia ana mɔ̃ɖaŋununya siwo kpena ɖe ame ŋu—abe screen readers ene—aɖe gbeƒã kpekpeɖeŋunya sia ne ezãla ƒe susu le nu ŋu alo ge ɖe edzi le mɔ̃a dzi.
Kpekpeɖeŋu nuŋɔŋlɔ si le ete nyawo ate ŋu awɔ atsyã kple .form-text. Klass sia display: blocktsɔa tame margin aɖewo dea eme eye wòtsɔa wo kpena ɖe eŋu hena dometsotso bɔbɔe tso nusiwo wotsɔ de eme siwo le etame gbɔ.
Ele be wò nyagbea nadidi ŋɔŋlɔdzesi 8-20, ŋɔŋlɔdzesiwo kple xexlẽdzesiwo nanɔ eme, eye mele be dometsotso, ŋɔŋlɔdzesi tɔxɛwo, alo emoji nanɔ eme o.
Inline text ateŋu azã inline HTML element ɖesiaɖe si bɔ (eɖanye <small>, <span>, alo nu bubu aɖe o) si me naneke wu utility class o.
Nuwɔametɔwo ƒe agbalẽviwo
Tsɔ disabledboolean nɔnɔme kpe ɖe nyawo tsɔtsɔ de eme ŋu be nàxe mɔ ɖe zãla ƒe kadodowo nu eye nàna wòadze abe ɖe wòle bɔbɔe ene.
Tsɔ disablednɔnɔmea kpe ɖe a <fieldset>ŋu be nàwɔ dziɖuɖu siwo katã le eme la nuwɔametɔe.
Nuxlɔ̃ame kple sekewo
Le gɔmedzedzea me la, web-browserwo awɔ nu ɖe native form controls ( <input>, <select>kple <button>elements) siwo katã le a me ŋu <fieldset disabled>abe nuwɔametɔwo ene, si axe mɔ na keyboard kple mouse siaa ƒe kadodo le wo dzi. Gake ne nusiwo le wò agbalẽvia me hã le eme <a ... class="btn btn-*">la, ke pointer-events: none. Abe alesi míede dzesii le akpa si ku ɖe nuwɔametɔ ƒe nɔnɔme ŋu na abɔtawo (eye vevietɔ le akpa sue si ku ɖe seke ƒe akpawo ŋu) me ene la, womeɖo CSS ƒe nɔnɔme sia ɖe ɖoɖo nu haɖe o eye womedo alɔe bliboe le Internet Explorer 10 me o, eye maxe mɔ na keyboard zãlawo be woagawɔe o te ŋu léa ŋku ɖe kadodo siawo ŋu alo wɔa dɔ le wo ŋu. Eyata be nànɔ dedie la, zã JavaScript si wowɔ ɖe ɖoɖo nu nàtsɔ awɔ kadodo mawo ŋudɔ.
Cross-browser ƒe dɔwɔwɔ ɖekae
Togbɔ be Bootstrap awɔ atsyã siawo ŋudɔ le web-browserwo katã me hã la, Internet Explorer 11 kple esiwo le ete mewɔa dɔ bliboe le disablednɔnɔme si le a <fieldset>. Zã JavaScript si nèwɔ ɖe ɖoɖo nu nàtsɔ axe mɔ ɖe fieldset la nu le web-browser siawo me.
Dadaɖeanyi
Na nyaŋuɖoɖo xɔasi, si ŋu woate ŋu awɔ dɔ le na wò zãlawo kple HTML5 ƒe agbalẽvi ƒe kpeɖodzi– si le míaƒe web-browser siwo katã míedoa alɔ me . Tia tso web-browser ƒe kpeɖodzinya ƒe nyaŋuɖoɖo gbãtɔa me, alo nàwɔ gbedasi tɔxɛwo ŋudɔ kple míaƒe klass siwo wotu ɖe eme kple JavaScript gɔmedzedze.
Míele aɖaŋu ɖom fifia be nàzã kpeɖodzinana ƒe atsyã siwo wowɔ ɖe ɖoɖo nu, elabena native browser default validation messages meɖea mɔ̃ɖaŋununya siwo kpena ɖe ame ŋu la fiana ɣesiaɣi le web-browserwo katã me o (vevietɔ, Chrome le kɔmpiuta dzi kple asitelefon dzi).
Wozãa HTML gbalẽvi ƒe kpeɖodzinana to CSS ƒe alakpa-klas eve dzi, :invalidkple :valid. Eku ɖe <input>, <select>, kple <textarea>nu veviwo ŋu.
Bootstrap scopes the :invalidkple :validatsyãwo na dzila .was-validatedƒe klass, zi geɖe la, wozãnɛ ɖe <form>. Ne menye nenema o la, agble ɖesiaɖe si wobia si me asixɔxɔ aɖeke mele o la adze abe mesɔ o ene le axa ƒe agbatsɔtsɔ me. To mɔ sia dzi la, àte ŋu atia ɣeyiɣi si nàwɔ dɔ le wo ŋu (zi geɖe la, ne wote agbalẽviawo ɖoɖo ɖa vɔ).
Be nàgbugbɔ aɖo agbalẽvia ƒe dzedzeme (le kpɔɖeŋu me, le agbalẽvia ɖoɖo ɖa si trɔna me to AJAX zazã me la), ɖe .was-validatedklass la ɖa le <form>agate ŋu le eɖoɖo vɔ megbe.
Abe fallback ene, .is-invalideye .is-validwoateŋu azã klasswo ɖe pseudo-classes teƒe na server side validation . Womebia .was-validateddzilawo ƒe klass o.
Le mɔxexe ɖe alesi CSS wɔa dɔe ta la, míate ŋu (fifia) awɔ atsyãwo ŋudɔ ɖe a <label>si va doa ŋgɔ na nuŋlɔɖi dzikpɔkpɔ le DOM me JavaScript si wowɔ ɖe ɖoɖo nu ƒe kpekpeɖeŋu manɔmee o.
Egbegbe web-browserwo katã doa alɔ constraint validation API , si nye JavaScript mɔnu siwo kplɔ wo nɔewo ɖo tsɔ ɖoa kpe agbalẽviwo dzi kpɔkpɔ dzi.
Nyaŋuɖoɖo ƒe gbedasiwo ate ŋu azã web-browser ƒe nɔnɔme gbãtɔwo (woto vovo na web-browser ɖesiaɖe, eye womate ŋu atrɔ asi le wo ŋu to CSS dzi o) alo míaƒe nyaŋuɖoɖo ƒe atsyã tɔxɛwo kple HTML kple CSS bubuwo.
Àte ŋu ana gbedasi siwo wowɔ ɖe ɖoɖo nu ƒe kpeɖodzinyawo kple setCustomValidityle JavaScript me.
Esi esia le susu me na wò la, bu míaƒe agbalẽvi ƒe kpeɖodzi ƒe atsyã tɔxɛwo, server ƒe akpa ƒe klass siwo woate ŋu atia, kple browser ƒe nɔnɔme gbãtɔwo ƒe wɔwɔfia siwo gbɔna ŋu kpɔ.
Atsyã siwo wowɔ ɖe ɖoɖo nu
Le Bootstrap ƒe nuŋlɔɖi ƒe kpeɖodzi gbedasi tɔxɛwo gome la, ahiã be nàtsɔ novalidateboolean nɔnɔmea akpe ɖe wò <form>. Esia na be browser ƒe nyaŋuɖoɖo ƒe aɖaŋuɖoɖo siwo woɖo ɖi la mewɔa dɔ o, gake eganaa mɔnukpɔkpɔ ame be wòakpɔ agbalẽviawo ƒe kpeɖodzi APIwo le JavaScript me. Dze agbagba nàtsɔ agbalẽvi si le ete la aɖo ɖa; míaƒe JavaScript la axe mɔ ɖe submit ƒe dzesi la nu eye wòagblɔ nyaŋuɖoɖowo na wò.
Ne èle agbagba dzem be yeaɖoe ɖa la, àkpɔ :invalidkple :validatsyã siwo wozã ɖe wò agbalẽvia dzi kpɔkpɔ ŋu.
Browser ƒe ɖoɖowɔɖiwo
Mètsɔ ɖeke le custom validation feedback gbedasiwo alo JavaScript ŋɔŋlɔ me be nàtrɔ agbalẽvi ƒe nuwɔnawo oa? Wo katã nyuie, àte ŋu azã browser la ƒe defaults. Te agbalẽvi si le ete la ɖoɖo ɖa kpɔ. Le wò browser kple OS nu la, àkpɔ nyaŋuɖoɖo ƒe atsyã si to vovo vie.
Togbɔ be womateŋu awɔ nyaŋuɖoɖo ƒe atsyã siawo kple CSS o hã la, àteŋu atrɔ asi le nyaŋuɖoɖo ƒe nuŋɔŋlɔa ŋu kokoko to JavaScript dzi.
Server ƒe akpa dzi
Míele aɖaŋu ɖom be nàzã client side validation, gake nenye be èhiã server side la, àteŋu afia agbalẽvi ƒe akpa siwo mele eteƒe o eye wosɔ kple .is-invalidkple .is-valid. De dzesii be .invalid-feedbackwodoa alɔe hã kple klass siawo.
Nusiwo wodo alɔe
Míaƒe kpɔɖeŋu nuŋlɔɖiwo fia native textual <input>s le etame, gake nuŋlɔɖi ƒe kpeɖodzi ƒe atsyãwo li na míaƒe agbalẽvi ƒe dziɖuɖu tɔxɛwo, hã.
Dɔwɔnu ƒe Aɖaŋuɖoɖowo
Ne wò agbalẽvi ƒe ɖoɖo ɖe mɔ ɖe eŋu la, àteŋu aɖɔli .{valid|invalid}-feedbackklassawo ɖe .{valid|invalid}-tooltipklasswo ta be woaɖe kpeɖodzinyaŋuɖoɖo afia le dɔwɔnu ƒe aɖaŋuɖoɖo si wowɔ ɖe atsyã me. Kpɔ egbɔ be dzila aɖe position: relativele asiwò hena dɔwɔnu ƒe aɖaŋuɖoɖo ƒe ɖoɖowɔwɔ. Le kpɔɖeŋu si le ete me la, esia le míaƒe kɔlam ƒe klasswo si xoxo, gake wò dɔa ateŋu abia ɖoɖo bubu.
Agbalẽvi siwo wowɔ ɖe ɖoɖo nu
Ne èdi be yeatrɔ asi le eŋu geɖe wu eye wòawɔ ɖeka kple browser la, zã míaƒe agbalẽvi ƒe akpa siwo nètrɔ asi le keŋkeŋ la nàtsɔ aɖɔli web-browser la ƒe nɔnɔme gbãtɔwo. Wotu wo ɖe gɔmesese kple dzesidede si ŋu woate ŋu aɖo la tame, eyata wonye nu sesẽ siwo woatsɔ aɖɔli agbalẽvi ɖesiaɖe si woɖo ɖi ƒe dziɖuɖu.
Dzesiɖakawo kple radiowo
Woxatsa aɖaka kple radio ɖesiaɖe ɖe a <div>me kple nɔvi aɖe <span>be míawɔ míaƒe custom control kple a <label>na nuŋɔŋlɔ si kpe ɖe eŋu. Le ɖoɖo nu la, esia nye mɔnu ma ke si míezãna le gɔmedzedzea .form-checkme .
Míezãa nɔvi tiatia ( ~) na míaƒe <input>nutoawo katã—abe :checked—be míawɔ míaƒe agbalẽvi ƒe dzesi si wowɔ ɖe ɖoɖo nu la ƒe atsyã nyuie. Ne míetsɔe kpe ɖe .custom-control-labelklass la ŋu la, míate ŋu awɔ nuŋɔŋlɔa ƒe atsyã hã na nu ɖesiaɖe le <input>'s nɔnɔme nu.
Míeɣlaa default la <input>kple opacityeye míezãa la .custom-control-labeltsɔ tua custom form indicator yeye ɖe eƒe teƒe kple ::beforekple ::after. Nublanuitɔe la, míate ŋu atu custom ɖeka tso ko me <input>o elabena CSS's contentmewɔa dɔ le element ma dzi o.
Le nɔnɔme siwo wodo kpɔ me la, míezãa base64 embedded SVG dzesiwo tso Open Iconic . Esia naa míekpɔa ŋusẽ nyuitɔ kekeake dzi le atsyã kple teƒeɖoɖo le web-browserwo kple mɔ̃wo dzi.
Dzesiwo ƒe Aɖakawo
Dzesiɖaka siwo wowɔ ɖe ɖoɖo nu hã ateŋu azã :indeterminatepseudo class la ne woɖoe kple asi to JavaScript dzi (HTML nɔnɔme aɖeke meli si woatsɔ agblɔe o).
Ne èle jQuery zãm la, ele be nane si le abe esia ene nasɔ gbɔ:
Radiowo dzi
Le fli me
Si me woɖe dzo le
Woate ŋu awɔ dzesideɖaka kple radio siwo wowɔ ɖe ɖoɖo nu hã nuwɔametɔe. Tsɔ disabledboolean nɔnɔme kpe ɖe la ŋu <input>eye woawɔ ɖoɖo ɖe nɔnɔmefianu tɔxɛ kple dzeside ƒe nuŋlɔɖi ŋu le eɖokui si.
Tia nuɖuɖu siwo le eme
Menu <select>tɔxɛwo hiã klass tɔxɛ aɖe ko, .custom-selectbe woaʋu atsyã tɔxɛawo. Atsyã siwo wowɔ ɖe ɖoɖo nu la se ɖe <select>'s ƒe dzedzeme gbãtɔ dzi eye womateŋu atrɔ asi le <option>s la ŋu o le web-browser ƒe seɖoƒewo ta.
Àte ŋu atiae hã tso tiatia suewo kple gãwo dome be woasɔ kple míaƒe nuŋɔŋlɔ siwo ƒe lolome sɔ kple wo nɔewo.
Wodoa multiplealɔ nɔnɔmea hã:
Abe alesi sizenɔnɔmea le ene la:
Kekeme
Wɔ ɖoɖo siwo wowɔ ɖe ɖoɖo <input type="range">nu kple .custom-range. Wotrɔ asi le hadzidzia (megbea) kple asibidɛ (asixɔxɔa) siaa ŋu be woadze ɖeka le web-browserwo katã me. Esi wònye be IE kple Firefox koe doa alɔ woƒe hadzidzia “yɔyɔ” tso asibidɛa ƒe miame alo ɖusime abe mɔnu si dzi woato afia ŋgɔyiyi kple ŋku ene ta la, míedoa alɔe fifia o.
Range inputs le implicit values na minkple max— 0kple 100, ɖe wo nɔewo yome. Àteŋu agblɔ asixɔxɔ yeyewo na amesiwo zãa minkple maxnɔnɔmewo.
Le gɔmedzedzea me la, range inputs “snap” na integer values. Be nàtrɔ esia la, àteŋu agblɔ stepasixɔxɔ aɖe. Le kpɔɖeŋu si le ete me la, míedzi afɔɖeɖeawo ƒe xexlẽme ɖe edzi zi gbɔ zi eve to step="0.5".
Faɛlwo ƒe nyatakakadzraɖoƒe
Faɛl ƒe nyawo tsɔtsɔ de emee nye gnarly wu le ƒuƒoƒoa me eye wòbia JavaScript kpee ne èdi be yeatsɔ wo aƒo ƒu kple dɔwɔwɔ Tia faɛl... kple faɛl ŋkɔ nuŋɔŋlɔ si nètia.
Míeɣlaa faɛl si woɖo ɖi la <input>to . Wowɔa abɔta la eye woɖonɛ ɖe teƒe si nye . Mlɔeba la, míeɖe gbeƒã a kple le la dzi na dometsotso nyuitɔ na nya siwo ƒo xlãe.opacity<label>::afterwidthheight<input>
Kaawo gɔmeɖeɖe alo wo tɔtrɔ ɖe nɔnɔmewo ŋu
Wozãa :lang()pseudo-class la tsɔ ɖea mɔ be woaɖe “Browse” nuŋɔŋlɔa gɔme ɖe gbe bubuwo me. Tsɔ gbegbɔgblɔ ƒe dzesi si sɔ kple ka siwo woɖo ɖe teƒea la ɖe asi alo tsɔ nyawo kpe ɖe $custom-file-textSass ƒe tɔtrɔ ŋu . Woate ŋu atrɔ asi le Eŋlisigbe me kaawo ŋu nenema ke. Le kpɔɖeŋu me, ale si ame ate ŋu atsɔ Spaingbe me gɔmeɖeɖe aɖe akpe ɖe eŋue nye esi (Spanishgbe me gbegbɔgblɔ ƒe kɔda nye ):es
Afi siae lang(es)le dɔ wɔm le faɛl ƒe nuŋɔŋlɔ si wowɔ ɖe ɖoɖo nu na Spaingbe me gɔmeɖeɖe ŋu:
Ahiã be nàɖo wò nuŋlɔɖia ƒe gbegbɔgblɔ (alo eƒe ati sue) nyuie hafi nuŋɔŋlɔ si sɔ la nadze. Woateŋu awɔ esia to nɔnɔme silang le <html>element la dzi alo Content-LanguageHTTP tanya la zazã me , le mɔnu bubuwo dome.