Fork me on GitHub
#re-frame
<
2019-12-02
>
Ramon Rios17:12:48

Hey guys. How do you put a field as required on re-frame?

p-himik17:12:38

There's not enough context to give any sort of answer. What's a field? Is it an HTML form field, a DB field, some other kind of field?

Ramon Rios17:12:46

Yeah, it's a HTML field

Ramon Rios17:12:18

I tried to put a :required on a {} but not worked as i tought

Ramon Rios17:12:10

{:value (get-in @current [:addresses address-type id]) :type type :on-change on-change-action :disabled disabled? :required}

p-himik17:12:51

Try {:required true}.

p-himik17:12:35

For future reference, such questions should be directed to #reagent since re-frame is just a data flow library, and it's reagent that manages all the DOM stuff.

Ramon Rios17:12:16

Ok, i didn't know about this channel 😅

p-himik17:12:53

It seems that's a channel for each more or less used library out there. 🙂 I've learned about a few useful libraries just by going through the list of channels here.

Pavel Klavík17:12:43

@UNZALKY4V all boolean attributes have to be set to true, since Reagent is using a Clojure map to set them, so there has to be a value