This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-18
Channels
- # admin-announcements (1)
- # aleph (3)
- # beginners (20)
- # boot (9)
- # cider (74)
- # clara (1)
- # cljs-dev (28)
- # cljsrn (15)
- # clojars (32)
- # clojure (149)
- # clojure-dusseldorf (3)
- # clojure-italy (6)
- # clojure-nl (3)
- # clojure-russia (20)
- # clojure-uk (5)
- # clojurescript (133)
- # core-async (2)
- # cursive (19)
- # datomic (24)
- # devcards (1)
- # funcool (100)
- # hoplon (48)
- # keechma (1)
- # kosmos (7)
- # ldnclj (3)
- # leiningen (3)
- # luminus (16)
- # off-topic (8)
- # om (103)
- # onyx (47)
- # pedestal (3)
- # proton (7)
- # re-frame (13)
- # reagent (11)
- # ring-swagger (1)
- # specter (6)
- # testing (12)
- # untangled (24)
- # yada (32)
Hello. I am testing a web form made with Hoplon. On IE 12, 11, 10, 9, when I submit form data and then hit refresh, some input fields are still filled (bad). But my form validation doesn't see them, so when I complete form the second time and try resubmit, it says fields are missing. I then need to manually remove text in field and type it again so it can work.
my state cell where I gather form data looks like this :
(defc form-data
{:commentaires nil
:nom nil
:courriel nil
:code-postal nil
:age nil
:abonnement-vpc nil
:source nil})
Maybe I should reset state just after sending...?
Not sure it answers but I have "lens" that resets part of the state cell when inputs change...
(form-group
:valid? form-name-valid?
(question "Nom")
(input-control
:cell (path-cell form-data [:nom])))
Maybe it doesn't answer your question @micha
that seems like it should initilize the form inputs with the values from the cells, no?
yes, but on IE, when i send the form once then I reload page, it doesn't reset
input fields are filled, but not seen by validator, weird!
the values were the one that I had filled before I sent the data the first time
yes, I guess they are not anymore in the cell, but somehow in memory for IE??
hahaha, yes!
let me try this! it'll take some time, because I need to deploy first in order to test with IE
@micha I was using :
(defelem cell-input [{:keys [cell] :as attrs}]
(let [target-value #(do! (-> % .-currentTarget) :value)]
(input (-> attrs
(dissoc :cell)
(assoc :type (:type attrs "text")
:style "border: 1px solid #dddddd; background-color: white;"
:input #(reset! cell (target-value %)))))))
target-value
I think this @%
doesn't work in IE (ideref error) but I'll try this instead :
(defelem cell-input [{:keys [cell] :as attrs}]
(input (-> attrs
(dissoc :cell)
(assoc :type (:type attrs "text")
:style "border: 1px solid #dddddd; background-color: white;"
:keyup (fn [e] (reset! cell (.val (js/jQuery (.-target e)))))))))
ahhhh, thanks!
maybe that was the problem... let's see!
@micha: I still have the problem 😞
Can I hate IE?
Can I force a reset of the fields globally?
Just after sending data for instance?
did you try this: http://www.w3schools.com/tags/att_form_autocomplete.asp
Let's try that! I do not have a <form>
tag as such, but I see we can use :autocomplete "off"
for input too
well, this doesn't seem to work either...
@micha: would you have a last idea?
just found this
found a jQuery hack :
function clearForm()
{
$(':input').not(':button, :submit, :reset, :hidden, :checkbox, :radio').val('');
$(':checkbox, :radio').prop('checked', false);
}
found also this : http://stackoverflow.com/a/6653616/1184248
not sure this is usable in my hoplon form. Will try tomorrow
thanks for your help today @micha !
@micha: @flyboarder a cond-tpl
or if-tpl
would be awesome. I was really confused as to why the performance of the page was so bad long after it had destroyed/rebuilt the DOM for “navigation” but I guess there’s reasons for that if stuff is still kicking around invisibly in memory