I have a form ([login to view URL]) which allows teachers to add questions to a database driven quiz.
They select the quiz id from the table entitled tbl_quiz_titles (sql dump attached) and add questions to this quiz.
Task: When a quiz id is selected, I would like the hidden password field to appear if there is a password corresponding to that id. (ie if password != "")
If there is no password associated with that quiz id, the password field should remain hidden and have no bearing on the form submission.
If the password field is required, the password entered should match the password for that quiz. If it does (perhaps checked when the user has typed it in, before pressing submit button - javascript?) then a message stating that this is correct should appear. I've also got a 'tick' (images/feedback/[login to view URL]) already on the form which could be used in association with this.
If the password does not match (again, checked once the user has typed it in, a message should say "The password does not match this quiz id" and the cross (images/feedback/[login to view URL]) should become visible.
The end result should mean that if there is no quiz password in the database, then the quiz_field (and [login to view URL], [login to view URL] etc) should remain hidden, but if there is a password associated with the selected id, the correct password should be entered before the form can be submitted.
Thanks,
Dave