Reputation: 739
I'm trying to add a PayPal button to a WordPress page (the textarea input uses TinyMCE version 3.5.8). The PayPal button has the following code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal"><input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="SOME_ID" />
<table>
<tbody>
<tr>
<td><input type="hidden" name="on0" value="Choose:" />Choose</td>
</tr>
<tr>
<td><select name="os0"><option value="Choice">Choice</option></select></td>
</tr>
</tbody>
</table>
<input type="hidden" name="currency_code" value="USD" />
<input type="image" alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" />
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0" />
</form>
Putting this HTML on the page works just fine, except there's a blank space above the table. Upon attemping to delete this extra space, TinyMCE removes the hidden inputs above the table.
Is there any way I can make TinyMCE not delete hidden inputs?
P.S. Since this is WordPress, I very-well could just put the PayPal code in custom shortcode; however I'd like to avoid this because it doesn't solve the real problem.
Upvotes: 2
Views: 433
Reputation: 50832
Have a look at the tinymce settings valid_elements and valid_children. You might need to set all the tags you use as valid tags and define the possible children to parentElements. Tinymce has a cleanup function that strips the content of invalid code.
Upvotes: 2