I have a term of use, and I need the button to be disabled until the user clicks on the "li and I agree to the terms of use.
I have a term of use, and I need the button to be disabled until the user clicks on the "li and I agree to the terms of use.
You only use the change
event of checkbox
to set the value of the disabled
property of the button.
const checkbox = document.querySelector('#chk');
const button = document.querySelector('#bt');
checkbox.addEventListener('change', (e) => button.disabled = !e.target.checked);
<input type="checkbox" id="chk" /> Li e concordo com os termos
<br>
<button id="bt" disabled>Prosseguir</button>
statement and code:
%pre%Make a program that stores movies produced by several directors and: - Create and read a vector of 5 directors, each containing name (maximum 20 letters), number of films and movies. The movie member is a vector, which must be created after reading the number of movies. Each film is composed of name, year and duration. - Look for a director by name, showing all the movies he has already produced. Repeat the process until you enter an empty string.
My question is: am I allocating the array correctly?
It does not work when I try to put more than 2 movies in the same director! Thank you.
My question is: am I allocating the array correctly?
Not at all. The allocation was done based on the %code% size, allocating a %code% vector but the %code% type is %code% :
%pre%In other words, it has allocated a vector of directors and saved it in a double char pointer, so the types and sizes do not play. If your array is an array of %code% to save strings declared as %code% then the correct allocation would be:
%pre%Note that I omitted cast because it is not required. I should also add that calling the %code% field would be much brighter than it represents, instead of %code% .
But I can not help saying that this does not answer the statement. The statement clearly states that:
Each movie consists of name, year and duration
Then %code% should be a structure:
%pre%And now this would be the structure used within %code% :
%pre%The allocation would now be:
%pre%Now it's not enough to adjust the remaining code for this new movie structure.