CrimsonDiva
Programmer
Hello,
I'm trying to create a reusable Javascript function (used with ASP) that will take in a textarea and set a cook with the value of that textarea. my function works fine if i dont pass any parameters, but when i try to pass in the name of the form field, it doesn't work. I believe my problem has something to do with objects, but I can't seem to figure it out. Here's some of my code:
JAVASCRIPT
function OpenPreviewWindow(fld){
var theform = document.frmCreate;
var thefield = theform.fld; <== Not working
var now = new Date
strMessage = escape(document.frmRegister.signature.value);
document.cookie = "Signature=" + strMessage;
openWin('newwindow.asp')...
}
ASP
<FORM NAME="frmCreate"...>
<A HREF="javascript: OpenPreviewWindow('openingblurb');">PreView Intro</A>
<TEXTAREA NAME="openingblurb" ID="openingblurb"...>
Please help!
Thanks,
Diva
I'm trying to create a reusable Javascript function (used with ASP) that will take in a textarea and set a cook with the value of that textarea. my function works fine if i dont pass any parameters, but when i try to pass in the name of the form field, it doesn't work. I believe my problem has something to do with objects, but I can't seem to figure it out. Here's some of my code:
JAVASCRIPT
function OpenPreviewWindow(fld){
var theform = document.frmCreate;
var thefield = theform.fld; <== Not working
var now = new Date
strMessage = escape(document.frmRegister.signature.value);
document.cookie = "Signature=" + strMessage;
openWin('newwindow.asp')...
}
ASP
<FORM NAME="frmCreate"...>
<A HREF="javascript: OpenPreviewWindow('openingblurb');">PreView Intro</A>
<TEXTAREA NAME="openingblurb" ID="openingblurb"...>
Please help!
Thanks,
Diva