Closed jithureddy closed 1 year ago
Hello @jithureddy, You can use Markdown formatting to add custom HTML and display a link in a question's title.
Consider this demo: View Demo.
const json = {
"elements": [
{
"type": "file",
"title": "Please upload your files <a style='color:red' href='a-link-to-download-a-file'>Download a Template</a>",
"name": "files",
"storeDataAsText": false,
"waitForUpload": true,
"allowMultiple": true,
"maxSize": 102400,
"hideNumber": true
}
]
};
const converter = new showdown.Converter();
survey.onTextMarkdown.add(function (survey, options) {
// Convert Markdown to HTML
let str = converter.makeHtml(options.text);
// Remove root paragraphs <p></p>
str = str.substring(3);
str = str.substring(0, str.length - 4);
// Set HTML markup to render
options.html = str;
});
For more information on how to enable Markdown formatting for surveys, refer to our online demo: Convert Markdown to HTML with Showdown.
I hope this demo helps. Please feel free to reactivate this thread if you have any questions or require further assistance.
Are you requesting a feature, reporting a bug or ask a question?
I wanted to add file upload question into my survey with an option to download the template. How to add this?
What is the current behavior?
There is a Description option for each question, Can we use this to add custom html
What is the expected behavior?