Click to See Complete Forum and Search --> : set value hidden field


gerjan
04-17-2003, 07:14 AM
Hello,

I'm trying to set the value from a hidden field.
I don't get it.
Maybe can somebody take a look at it and tell me why it does not work.

http://www.compenz.nl/gerjan/schrijf/teksteditor/

I wan't to send the data that's filled in, to send when the "save" button is clicked.
It supposed to send with the hiddenfield on line 212.

Tnx in advange!

khalidali63
04-17-2003, 07:16 AM
document.formName.hiddenFieldName.value = "whatever the value is"

Hope this helps

Cheers

Khalid

gerjan
04-17-2003, 08:30 AM
I'm more an ASP developer than a Javasript pro.
Would you like to add it in my script?

I would realy appreciate that.

khalidali63
04-17-2003, 09:28 AM
needs testing,but am sure it will work
Vhange the form element
<form action="getcontent.asp" method="post" name="onlineeditor">

to

<form action="getcontent.asp" method="post" name="onlineeditor" onsubmit="javascript:this.content.value=idContent.document.body.innerHTML">
and the hiddent field should look like this

<input name="content" type="hidden" value=''>

Hope this helps

Cheers

Khalid

jeffmott
04-17-2003, 10:00 AM
onsubmit="javascript:this.content.value=idContent.document.body.innerHTML"The javascript: should not be there. The value of onsubmit (and all other event attributes) are entirely script data. So unless javascript: is part of a valid statement in the particular language, it shouldn't be there.

gerjan
04-18-2003, 02:38 AM
khalidali63
:D Thank you very much!!
It DOES work.