I have an application which you can view by accessing its url.
Application 1 (javascript validation message): application
Code layout: Jsfiddle
In this application when you access it you will see an empty textbox and a button. If you leave the textbox empty and click on the button, you will see a message appear below through javascript stating “Please Enter in a Room Number”.
The problem though is my JSON and php. What is suppose to happen is that if the value in the room textbox matches the value in the database, then it is suppose to display a message below textbox “Room is Valid”, if it doesn’t match in the database then it should display “Room is Invalid”. Problem is that those messages do not appear.
How can I get the messages to appear?
To test a valid room number use this value: CW5/10
Ok first thing is in this javascript
is not passsing the validation() part because your default isDataValid boolean starts off false and never goes to true so it never gets past validation.
Second thing is
it will never get here because you are not posting “prequestion” anywhere. You have it as the name of the submit button but thats only if you allow the form to postback, your javascript function is not sending ‘prequestion’ because the form doesn’t submit, it calls the function ‘postback’. Fix those and that should allow you to get JSON back from the server.