Posts

How to display date in ordinal form in Coldfusion

 There are some requirements where we need to display the date value as ordinal form. For example, 31st august. Below code will do that in coldfusion. <cfset SuffixList=["st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th", "st"]> <cfoutput>#DateFormat(now(),'d')##SuffixList[DateFormat(now(),'d')]#</cfoutput>

How to get only the number from a alphanumeric String in ColdFusion

 If the input contains numbers and characters, and we need to get only the numeric part from that, we can use reReplace Function in Coldfusion like this: <cfset test = "rtf4545"> <cfset result = reReplace(trim(test),"[^0-9\.]+","","All")> <cfoutput>#result#</cfoutput> Output: 4545

How to add a custom confirmation message in google forms

Image
 Once google form is submitted, you can customize the confirmation message which shows to the user. To do so please follow the video as given below:

PDF lib error : End character U+003E for inline option list not found in 'PDFlib_com.PDF'.

Since PDf lib uses < and > characters for start and end tags, if your text contain these characters it will throw the error like below: End character U+003E for inline option list not found in 'PDFlib_com.PDF'. So for fixing these issues, we can give the option begoptlistchar to "none".   So the code can be like :   oPDF.create_textflow("test < 10","begoptlistchar=none")>

How to add new line in google form confirmation message

Image
Confirmation messages are displayed after submitting the form / questions by the receiver. To add new line in the confirmation message, run the below script in the script editor. function   addLineBreaks () {    var   form  =  FormApp . getActiveForm ();        var   title  =  "Thanks for your submission. We will get back to you sooon" ;    form . setConfirmationMessage (  title . split ( ". " ). join ( "\n" ));    } For reference :

How to add new line in the 'add title and description' section in google forms

Image
 Adding new line in the section 'add title and description'  in google forms can be done by running below code in the script editor : code to copy: function addLineBreaks() {   var form = FormApp.getActiveForm();       // find form items you need    var questions = form.getItems(FormApp.ItemType.SECTION_HEADER);      for(i = 0; i < questions.length; i++)   {     var title = questions[i].getTitle();     questions[i].setTitle(title.split(". ").join("\n"));     var desc= questions[i].getHelpText();     questions[i].setHelpText(desc.split(". ").join("\n"));   } } Below video will give complete steps to do this :