Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect Form Submission
Message
 
To
03/03/2004 01:54:00
General information
Forum:
Internet
Category:
Javascript
Miscellaneous
Thread ID:
00882025
Message ID:
00882684
Views:
13
Ok, I can see the context now :-)


My advise is to move the behaviour to the form element.
Add 2 custom properties to the behaviour, one to refer to the DIV id
and another to refer to the TEXTAREA ID.
<PUBLIC:COMPONENT>
   <PUBLIC:PROPERTY NAME="theDiv" />
   <PUBLIC:PROPERTY NAME="theText" />
   <PUBLIC:ATTACH EVENT="onsubmit"  ONEVENT="CopyData()" />
</PUBLIC:COMPONENT>

   <SCRIPT>
     function CopyData()
     { 
        myDiv=element.document.getElementById(element.theDiv);
        myText=element.document.getElementById(element.theText);
        myText.value=myDiv.innerText;
     }
   </SCRIPT>
This way, in the form tag you just have to insert the new props and
the behaviour will access it in the onsubmit()->CopyData() event:
<form style="behavior: url(behavior.htc);" theDiv="myDivID" theText="myTextAreaID" ... >
   <textarea name="Content" ID="myTextAreaID"></textarea>
   <div ID="myDivID"></div>
     ...
This should work OK :-)
HTH

>Hi Gerald,
>
>Thanks for your reply.
>
>Well... I am working on a project where I am adding a behavior to a html textarea (see below). In the ".htc" file the contents are copied from the form element (textarea) into a div.
>
><textarea name="Content" style="behavior: url(behavior.htc);">
>
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Reply
Map
View

Click here to load this message in the networking platform