Bug Tracker

Opened 9 years ago

Closed 9 years ago

#7284 closed bug (invalid)

.val() returns object instead of value if TinyMCE active

Reported by: trurl-master@… Owned by: trurl-master@…
Priority: low Milestone: 1.5
Component: attributes Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:

Description

test case:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="path/to/tinymce/jquery.tinymce.js"></script>

<form>
	<div>
		<input type="text" name="a" value="a_value" />
		<textarea name="b">b_value</textarea>
		<input id="send" type="submit" value="send" />
	</div>
</form>

<div id="out"></div>

<script type="text/javascript">

$(document).ready(function() {
	
	$('textarea').tinymce({
		script_url : 'path/to/tinymce/tiny_mce.js'
	});
	
	$('#send').click( function() {
		$(':input:not(:submit)').each( function() {
			//$('#out').append( '<br />' + this.name + ' -> ' + $(this).val() );
			console.log( $(this).val() );
		});
		
		return false;
	});
});

</script>

Change History (10)

comment:1 Changed 9 years ago by Rick Waldron

Component: unfiledattributes

Need verification that this is jQuery's problem and not TinyMCE

comment:2 Changed 9 years ago by Rick Waldron

Priority: undecidedlow

comment:3 in reply to:  1 Changed 9 years ago by anonymous

Replying to rwaldron:

Need verification that this is jQuery's problem and not TinyMCE

Not sure how i can do this. It works fine with 1.4.2. Maybe this more accurate test case will prove it(sorry it's not in jsFiddle, they do not have tinymce):

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="path/to/tinymce/jquery.tinymce.js"></script>


<input id="test" type="text" name="a" value="a_value" />

<form>
	<div>
		<textarea name="b">b_value</textarea>
	</div>
</form>

<button id="send">send</button>

<div id="out"></div>

<script type="text/javascript">

$(document).ready(function() {
	
	$('textarea').tinymce({
		script_url : 'path/to/tinymce/tiny_mce.js'
	});
	
	$('#send').click( function() {
		console.log( $('#test').val() );
		return false;
	});
});

</script>

It returns $('#test') object instead of value. Same in Firefox, Opera and Chrome, IE not tested.

comment:4 Changed 9 years ago by snover

Owner: set to trurl-master@…
Status: newpending

Please provide a live test case.

comment:5 Changed 9 years ago by trurl-master@…

Status: pendingnew

comment:6 Changed 9 years ago by Rick Waldron

This is the output I'm getting from your test case (copied locally, unmodified)

http://gyazo.com/9b8a0ae94651f762043ef08338fe2fc3.png

comment:7 Changed 9 years ago by trurl-master@…

Thats how my test case looks: http://dl.dropbox.com/u/413967/7428_testcase/out.png

Checked on Ubuntu(firefox, opera, chrome) and Win7(chrome).

comment:8 Changed 9 years ago by SlexAxton

Status: newpending

This should probably be narrowed down without the third party library. No one has time to go through the TinyMCE code to see what's going on. Can you provide an html structure that causes jQuery to fail on val ? Perhaps inspect the DOM and try to recreate the issue by hand.

Thanks

comment:9 Changed 9 years ago by trurl-master@…

Status: pendingnew

Can close one, latest tinymce don't have this issue.

comment:10 Changed 9 years ago by snover

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.