The code that I tried getting to work is marked in bold. I tried multiple different ways and I couldn't get the text to show up in the HTMLEditor.
BTW, I found javascript code to disable the Validators on the ProductAdd.aspx page so I could run this script without having to save the product. I added some content to the ProductAddInfo.ascx page and when an Administrator enables the content by clicking on a radio button, here is the javascript that runs to disable the validators. Also, the Administrator can disable the the added content and re-enable the validators by selecting a different radio button:
function AWS(rad) { if (rad.value == "true") { document.getElementById('rowAWS').style.display = 'table-row'; for (i = 0; i < Page_Validators.length; i++) { ValidatorEnable(Page_Validators[i], false); } } else { document.getElementById('rowAWS').style.display = 'none'; for (i = 0; i < Page_Validators.length; i++) { ValidatorEnable(Page_Validators[i], true); } } }
The validators are automatically created on the page in a JavaScript array called Page_Validators. Accessing them and turning them off is as simple as the JavaScript code above.
I'm trying to add dynamic content to the HTMLEditor in the ProductAdd page. I've tried everything. Anybody have some advice?
if i follow you, you want code to run on the product page of a particular product?
how about creating a new product template for this product and hard coding the above to that particular template - you could then use that template for any product you choose