These are chat archives for Colt/WDB-CodeTalk

6th
Mar 2017
Ridwan Abiola
@abu-hasib
Mar 06 2017 07:11
Hi guys new aspiring web developer on the block
Preye4annular
@Preye4annular
Mar 06 2017 08:45
Hello guys! I need help. I was downloading the full WDB course via powershell and my download was interrupted. pls how do i continue the download from where it stopped
sorry guys... in a different room
Maegan Womble
@MaeganW
Mar 06 2017 18:08
Hello, first time here! Hope I'm in the right room for questions. If not, please let me know! I signed on because I have a question about the forms assignment. I want to make the "terms accepted" portion required so that the form will not submit without the checkbox being checked. I used the following code, but did not achieve the expected result. Any suggestions?
    <label for="accepted">I agree to the terms and conditions: </label>
    <input id="accepted" type="checkbox" name="accepted" value="yes" required>
Boomer
@boomer1204
Mar 06 2017 18:10
@MaeganW out of the box HTML5 does not support that
You could put a div around the checkbox and use some js to check if it it's checked and if it isn't do not allow the form to submit
Maegan Womble
@MaeganW
Mar 06 2017 18:11
Ahh... Got it. I will try that when I learn JS then. Thanks.
Boomer
@boomer1204
Mar 06 2017 18:13
np
eqbalashraf
@eqbalashraf
Mar 06 2017 18:23
@MaeganW Try to put the div around the checkbox that should work. Mine is working. I kept that in p tag
<p>
<label for="agreed"> I agree to the terms and conidtions</label>
<input id="agreed" type="checkbox" name="agreed" value="yes" required>
</p>
Maegan Womble
@MaeganW
Mar 06 2017 18:26
Thanks. Let me try that in the browser...
Hey it worked? But why? This was my original line of code, except with out p tags in had divs.
<div>
    <label for="accepted">I agree to the terms and conditions: </label>
    <input id="accepted" type="checkbox" name="accepted" value="yes">
</div>
sorry. Add required to that.
I deleted the required after I realized it wasn't working
<div>
    <label for="accepted">I agree to the terms and conditions: </label>
    <input id="accepted" type="checkbox" name="accepted" value="yes" required>
</div>
eqbalashraf
@eqbalashraf
Mar 06 2017 18:30
@MaeganW That's working with div tag too.
Maegan Womble
@MaeganW
Mar 06 2017 18:30
Nevermind! I found the problem!
Thank you for your help!
eqbalashraf
@eqbalashraf
Mar 06 2017 18:31
@MaeganW You're welcome
Babolin Giordano
@babolinGiordano
Mar 06 2017 21:12
Hello, I have a question/problem.. why this code while(answer !== 'yes' && answer !== 'yeah' ) enter in the while if answer is equa;l to yes?? AND don't mean both args = true??
Keltouma
@KeltoumaT
Mar 06 2017 21:15
this means that while answer is not yes and not yeah whaterver happen @babolinGiordano
Babolin Giordano
@babolinGiordano
Mar 06 2017 21:17
ok, but i understod both side of && need to be yes for enter a nd not only one (only one is for OR ||)
Keltouma
@KeltoumaT
Mar 06 2017 21:17
yes both sides need to be true.
what happen when you run the code ?
Babolin Giordano
@babolinGiordano
Mar 06 2017 21:18
ok, so why if I enter yes my code enter in the while parts?
is the code in lesson 98
Keltouma
@KeltoumaT
Mar 06 2017 21:19
it won't work unless there is yes AND yeah
Babolin Giordano
@babolinGiordano
Mar 06 2017 21:25
@KeltoumaT thanks..
Keltouma
@KeltoumaT
Mar 06 2017 21:26
@babolinGiordano you're welcome