Add HTML Input field in GlideModal window

Rohit Agarwal1
Tera Contributor

Hi,

 

I want to add a HTML input field in GlideModal window (same as the attached screenshot).

RohitAgarwal1_0-1752915403302.png

is this possible? Please suggest.

 

@Ankur Bawiskar : Any suggestion?

 

7 REPLIES 7

Hi @Rohit Agarwal1 , 

Just to confirm everything is working correctly, try copying and pasting the exact code below into the UI page—it’s the same code that worked on my end.

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<!-- Short Description (String) -->
<label for="short_description">Short Description</label><br/>
<input type="text" id="short_description" name="short_description" style="width: 100%;" maxlength="100" /><br/><br/>
 
<!-- Full Description (Rich Text/HTML) -->
<label for="full_description">Full Description</label><br/>
<script src="/scripts/tinymce4_4_3/tinymce.full.jsx"></script>

<script>
tinymce.init({
mode : "specific_textareas",
editor_selector : "mce",
width: '100%',
height: '500px',
menubar: "tools",
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | bullist numlist',
content_css : "* {font: 10px arial, sans-serif;} b {font-weight:bold;} th {font-weight:bold;} strong {font-weight:bold;}",
});

</script>
<textarea cols="80" rows="10" id="myArea" name="myArea" class="mce"></textarea>
<br/>
<br/>
<div style="text-align: left;">
<button type="button" id="submitBtn" onclick="submitForm()">Submit</button>
</div>
<script>
// Example submit handler function:
function submitForm() {
alert("form submitted");
}
</script>
</j:jelly>
 
________________________________________________________________________________ 

try copying and pasting the exact code below into the UI action:

 

function test()
{
var dialog = new GlideModal('rich_text_modal'); // give the ui page name in place of 'rich_text_modal' 
dialog.setTitle('Rich Text Editor'); 
dialog.setSize('500','500');
dialog.render();
}
 

If my response resolved your query, please consider marking it as helpful.


Thank you,
Sriharsha

Hi Sriharsha,

It's not working.  I am getting below error in browser console.

 

MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

 

Thanks!!

Ankur Bawiskar
Tera Patron
Tera Patron

@Rohit Agarwal1 

what's your business requirement?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader