I have a hidden field. After the drop event, it should be converted to "textarea".
It:
excerpt = $(parent).find('#excerpt').attr('type', 'textarea'); excerpt.val('textarea');
Produces
cannot be changed
error
This method: Change element type from hidden to input
marker = $('<span />').insertBefore('#myInput'); $('#myInput').detach().attr('type', 'textarea').insertAfter(marker); marker.remove();
Nothing uses "textarea", but only works for "text". Addendum:
.val('HERE')
TO:
$('#myInput').detach().attr('type', 'textarea').val('HERE').insertAfter(marker);
the string changes the value of the text field, so the selector works, and the <span> element is inserted and deleted correctly.
Is this an insurmountable security issue? Or is there a way to do this?
source share