Often to the major web site to leave a message or post a friend should know that many sites are now the message place of the verification code is not directly displayed. It is only after the click of the Verification Code input box will show the verification code. The following author also summed up an article on how to use JS to click the text box and then load the verification code effect.
No more nonsense to say, the following is the specific implementation code.
The above is very simple, in fact, more popular and practical should be Ajax form, below to see the use of Ajax to achieve this effect of the method .
(1) The first is to generate the code of the PHP file (checkcode.php), there is no reference to the following two articles, here is not to put the code.
PHP Build Verification Code function
PHP Generate dynamic Verification code picture
(2) The specific HTML file and processing code are as follows:
The above is to achieve click on the text box before loading verification code JS Code, I hope you like.