Skip to content

Commit

Permalink
Added radio/checkbox demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
RillingDev committed Mar 15, 2021
1 parent 226e2c1 commit c84fbd1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ <h1>Demo 2 - Advanced Inputs</h1>
<textarea id="demo2_msg" placeholder="Your message"
data-ok="message" required></textarea>
</div>
<div class="form-group">
<p>Communication Mode (Phone is broken right now!)</p>
<input type="radio" id="demo2_contactChoice1"
name="contact" value="email" checked>
<label for="demo2_contactChoice1">Email</label>
<input type="radio" id="demo2_contactChoice2"
name="contact" value="phone" data-ok="radioPhone">
<label for="demo2_contactChoice2">Phone</label>
<input type="radio" id="demo2_contactChoice3"
name="contact" value="mail">
<label for="demo2_contactChoice3">Mail</label>
</div>
<input type="submit">
</form>
<script type="module">
Expand All @@ -129,6 +141,10 @@ <h1>Demo 2 - Advanced Inputs</h1>
message: {
msg: (val) => `Please enter an even number of characters (You entered ${val.length})`,
fn: (val) => val.length % 2 === 0
},
radioPhone: {
msg: () => "Sorry, Phone communication is not allowed here. (Why do we even allow checking this? I dunno)",
fn: (checked) => !checked
}
});

Expand Down

0 comments on commit c84fbd1

Please sign in to comment.