Hi Chris,
I am trying to create a quiz page where subjects need to fill in multiple form fileds. To give them a reinforcement feedback on the correct answers, I want them to firstly submit the answers and have their answers validfied. (Thus, I have multiple error messages defined.) If they got all the answers correctly, I want them to see the "Next" button. Just in case some people want to take a quick look on the correct answer.
Here are the codes I plan to use:
<input name='quiz1_D' id='quiz1_D' type='number' style='width: 60px;' placeholder="integer"/> points </div>
<input name='quiz1_C' id='quiz1_C' type='number' style='width: 60px;' placeholder="integer"/> points </div>
....
<div>
<input type="submit">
</div>
<button class='otree-btn-next btn btn-primary' id='NextButton' style='display:none;'>Next</button>
I want to change the "Next" button to display once all the forms are validified. My question is how to overwrite the type="submit" to forbid automatically going to the next page OR how to write an onclick() function that can both submit and validify the forms with my defined error messages in _init_.py, then I can change the display settings to my Next button. I wonder which method is a better one.
Hope my question is clear and thanks in advance for the help!
Best,
Xinxin