Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register FFQ button disabled after incorrect attempt #309

Open
ayobi opened this issue Jan 19, 2024 · 0 comments
Open

Register FFQ button disabled after incorrect attempt #309

ayobi opened this issue Jan 19, 2024 · 0 comments

Comments

@ayobi
Copy link
Contributor

ayobi commented Jan 19, 2024

When I go to 'My FFQs and try to submit a incorrect Registration Code, the 'Register FFQ' button gets disabled and you are unable to click it again despite it saying 'Please try again' below. See attached image.

Expected behavior: 'Register FFQ' button remains clickable to allow more attempts.

@ayobi ayobi changed the title Register FFQ button greyed out after incorrect attempt Register FFQ button disabled after incorrect attempt Jan 23, 2024
lmerchant added a commit that referenced this issue Feb 14, 2025
… retry: Issue #309

The problem was code disabling the button right away rather than waiting and disabling it
after the form is validated to prevent multiple submissions

Add type='submit' to form submit button.
For the submitHandler in the Jquery Validation Plugin to get called, it requires
a button inside the form with the type='submit'.

Add code to return JSON format of python True or False value in implementation.py
In the implementation.py file, the function get_ajax_check_ffq_code validates the form
entry, and it needs to return a JSON value of true or false since it is returning the value
to a JavaScript function that doesn't understand python True or False. This function
was changed to return JSON of a True or False value.

Put the submitHandler of the validator outside the 'rules' object in order
for it to be called.

Test using a return value of True and False in the function get_ajax_check_ffq_code in the
implementation.py file to call the submit handler function. Now the submit handler
is called on a returned True value and the message of an invalid key is displayed
on a returned False value.

Add comment in submit handler function to create a function call in the
submit handler which is empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant