Possible to retrieve properties/values from Java object?
Posted: Tue Oct 24, 2006 10:06 am
.. into a form, in 'realtime'?
Someone has asked me to look into the possibility of using a Java applet as a CAPTCHA, but to avoid submitting a form and/or new page request, so ideally they would like a generated value from the applet to be available 'realtime' for submission with the rest of the form, or is submitted as the resulting value..
Is this possible?
So the html would look something along the lines of:
Someone has asked me to look into the possibility of using a Java applet as a CAPTCHA, but to avoid submitting a form and/or new page request, so ideally they would like a generated value from the applet to be available 'realtime' for submission with the rest of the form, or is submitted as the resulting value..
Is this possible?
So the html would look something along the lines of:
Code: Select all
<html>
<body>
<script type="text/javascript">
function doStuff()
{
var data = document.getElementById('applet').myAppletPropertyOrValue;
//do something with data..
}
</script>
<form action="page.php" method="post" onSubmit="doStuff(); return false;">
<object name="MyJavaApplet" id="applet" code="MyApplet" />
<input type="submit" />
</form>