If you want to do it in the client side and not in the server side it is relatively simple to use AJAX from JQuery.
- You could make the 'Submit' button ('Accept' or whatever name you find appropiate) be disabled at page load.
- When the user changes the text in the input control you can detect the text changed event and use AJAX to (in the background) try to download one text/xml document from your site. You can use the text in the input control as part of the query.
- In the server side, when it receives the request for the file (you should of cource trap it as it will refer to non existing page/document) your code should check in the database for the presence or not of that text and return the appropiate content which may simply be one '1' or one '0'.
- On the handler for the event fired when the download has been completed (client side, captured in JQuery) you take that value and decide enabling/disabling the 'submit' button.
It is complex to put it all together but gives the impression of being all done client-side.
The simplest way to do it is with server side data validation.
This piece of code could help you:
Put something like this on the event handler:
LoadMyFile("myfiles/oneXmlFile.xml", function(xml) {
});
And make this function available for your page code. sourceDoc is the url and Ready the callback called when the filed download succeeds.
function LoadMyFile(sourceDoc, Ready) {
$.ajax({
type: "GET",
url: sourceDoc,
dataType: "xml",
success: function(xml) {
Ready(xml);
}
});
}
p.d. That's how i did something similar some time ago, but creating and testing some code for you could take too long now.