this is my code i m working on... file name is login.jsp having another file vcaptcha.jsp i want when the user click on refresh button only the captcha made by vcaptcha.jsp is refreshed not the whole page.. i have not much idea abt jsp and javascript... so please hell me out in this matter..
Thanks alot buddy... how better i m feeling today...
Now i m going to tell u my real problem as i have a hope u can help me out...
i have to build a captcha with both visual and audio captcha i m able to made visual captcha but not audio captcha with the help of vcaptcha.jsp i m able to generate image jpeg nd nw i have to create audio captcha.. i m thinking that random string is generated like 3rStAd then when i move my mouse on speaker image it speak "number three lowercase r uppercase S lowercase t uppercase A and finally lowercase d"
i have no idea about jsp, php... but i have seen this page.. http://www.nswardh.com/shout/ i also want to create audio captcha is like this...
due to ur help my code becomes this now..
<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<%
String error=request.getParameter("error");
if(error==null || error=="null"){
error="";
}
%>
<html>
<head>
<title>Captcha</title>
<script>
function validate()
{
alert("Captcha empty");
document.frmLogin.usrValue.focus();
return false;
}
function refresh()
{
document.getElementById("captcha").src='vcaptcha.jsp?'+(new Date().getTime());
}
Captcha Code <input type="text" name="usrValue" /><br />
<br />
<input type="reset" name="Refresh" value="Refresh" />
<input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>
and got my vcaptcha.jsp code from here... i need it to be done by friday... so its urgent plz if posb help me out...
one more problem now i m facing... after ur code.. i am able to refresh when i click on to refresh button but when i take my mouse on speaker image then it gives me error and does not play any single sound.. it is working properly when there is no refresh button code is there... the updated code i have already posted...
<div id="captcha"><img src = "vcaptcha.jsp" ID = "captcha">
You have used the ID "captcha" for multiple elements. In order for JavaScript to correctly locate elements using the getElementById function, the query ID must be unique.
As for the audio, the only way to complete that with javascript is to create multiple audio files and get them to be played sequentially. The only problem with that is, an application could be designed to read the JS coding of the audio algorithm in order to circumvent the purpose of using captcha... I would look around on the internet for ways of combining audio files to be sent to the client through the use of server-side code such as PHP. I hope I didn't make this sound too difficult for you...
Okay, that's alright. But the sound isn't necessary, is it? I mean combining sound files using JS isn't exactly reliable because there will have to be multiple sound files loaded and played using timeouts. If you could get the sound files and write down the lengths of each, I'll help you write the code to string it all together.
Bookmarks