|
Posted by Jonathan N. Little on 08/24/05 07:00
allanrodkin@hotmail.com wrote:
> Hi Mr. Dorward,
> I have a couple questions about the first solution you gave.
>
> <form action="myPerlScript.pl" onsubmit="someJavaScriptFunction()">
> <div>
> <input type="submit">
> </div>
> </form>
>
> Forgive me for my ignorance in this matter. Using this code, I'm
> assuming the JavaScript function executes first. If so, how do you
> return the values you want from the JavaScript function so I can send
> them to the perl script?
>
>
> Thanks,
> Fred
>
If it is a posting to a form, then have some input fields, usually
'hidden' for this purpose that the JavaScript sets their value before
submition of the form.
<script type="text/javascript">
function someJavaScriptFunction(){
var f=document.forms[0];
...
f.toBeSet.value="Some Value Derived by JavaScript";
...
return true;
}
</script>
....
<form action="myPerlScript.pl" onsubmit="someJavaScriptFunction()>
<input type="hidden" name="toBeSet">
....
</form>
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|