Login Register

Quetion about submitting text contained in textEditor widget

I am using input (submit) button and would like to post the text contained in the textEditor Widget but was unable to find a way to do so.

While using Form.TextArea i can get a value on the server side (as the value parameter is updated while typing). When using text editor control only the innerHtml (more specifically the value in the body tag) of the iframe is updated. it would be good if the texteditor updated "value" parameter, as a user types, so that the HTML formated text can easily be retrieved on the server side. Maybe i am missing something but I didn't find something like this already implemented.

-Marko Vuksanovic

I have used a workaround to

I have used a workaround to solve the problem with getting the value from the TextEditor. The workaround is posted below (it is a ruby on rails code). I have hidden the textarea that should hold the text. The <%= form.text_area :description, :style => "display:none;" %> generates the following html

Then, when a user clicks the submit button, a small javascript code sets the value of the text area (generated by the form helper) to the one of the TextEditor widget. After that the form is submitted and the object ("ticket") is correctly populated. I guess there should be a more elegant way of achieving the same functionality.

		Please enter ticket information
		
		<% form_for :ticket, :url => { :action => :save_ticket } do |form|%>
		
			Title:
			<%= form.text_field :title, :size => 40 %>
		
		
			Description:
			<%= form.text_area :description, :style => "display:none;" %>
		
		
			
			
		
		
			<%= submit_tag "Save ticket", :class => "submit", :onclick => "document.getElementById('ticket_description').value = dijit.byId('ticket_description_dojo_text_editor').getValue();" %>
		
		<% end %>
	

exactly same problem

hey Marko,

I've got exactly the same problem.

TextArea works fine
Editor not

Is there somebody here who can explain us why the
wysiwyg-editors' content never gets submitted?

without that optionit is worthless, so I believe
that I'm doing std. wrong??

My code is like in the sample, a exists and
the form is submitted via dojo xhr, so I can not see
my failure.

thx for help!!