Opened 14 years ago

Closed 14 years ago

#424 closed defect (invalid)

Submit to Publish

Reported by: aaron@… Owned by: akaEdge
Priority: normal Milestone:
Component: Documentation Version:
Severity: normal Keywords:
Cc:

Description

For the life of me, I can't figure out how to send the 'ta' or 'myTextArea' variable so I can publish the output to an include file.
How I did it in htmlarea:

<body onload="initEditor()">
<form method="post" action="/cgi/publish.cgi">
<textarea id="ta" name="ta"><?php echo="$html"; ?></textarea>
<input type="submit" value="Submit">
</form>

Is there any way I could just call Xinha to the <textarea> without having to use the div tag?

SEE BELOW

BTW... Thanks for all the work you've done. Xinha, from what I can see, puts htmlarea to shame. Now I just need to figure out how to make it work with my system :)!
~Aaron

<form id="editors_here">
<textarea id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%"></textarea>
</form>
<div id="lipsum" style="display:none">
Examples Text Here!
</div>
<script type="text/javascript">

xinha_editors = [ ]

var ta = 'myTextarea';
xinha_editors.push(ta);

var f = document.forms[0];
f.innerHTML = ;

var lipsum = document.getElementById('lipsum').innerHTML;

var div = document.createElement('div');
div.className = 'area_holder';

var txta = document.createElement('textarea');
txta.id = ta;
txta.name = ta;
txta.value = lipsum;
txta.style.width="475px";
txta.style.height="420px";

div.appendChild(txta);
f.appendChild(div);

check submitted values
var submit = document.createElement('input');
submit.type = "submit";
submit.action = "/cgi/publish.cgi";
submit.id = "submit";
submit.value = "submit";
f.appendChild(submit);

</script>

Change History (2)

comment:1 Changed 14 years ago by mharrisonline

The original demo.html way to embed HTMLArea3 still works perfectly well with Xinha. I have to use it myself to avoid losing button functionality (in my case highlight text, preview page and insert html) that was present when the editor was HTMLArea 3.

As far as I can tell, it's not possible to do this with the Xinha-approved way too put the editor on a page (even with only one editor), so I can't use the new code at all. I had asked how to do this in the Newbie Guide some time ago, but no one answered. It looks like the buttons are HTMLArea3 functionality that Xinha lost the day demo.html was removed from the examples folder. I hope someone will someday prove me wrong.

comment:2 Changed 14 years ago by gogo

  • Resolution set to invalid
  • Status changed from new to closed

Nothing wrong with your code as posted, presuming you have a function called initEditor() which creates xinha etc.

Sure you're not calling form.submit() directly? Remember that if you do that that the browser will not call the onsubmit() event for the form - that is only called when somebody pysically clicks on a submit button - so if you're calling form.submit() you need to manually call the onsubmit() first.

In any case -> Forum thanks.

Note: See TracTickets for help on using tickets.