Welcome to Portal

?Unknown\pull-down

Welcome to Zoho Cares

Bienvenido a Soporte de Zoho

Search our knowledge base, ask the community or submit a request.

Hi everyone,


The world is going through a difficult time right now, and we hope you're all staying safe.


We're here with another Creator tip—this time on how to add background images to your forms. Sometimes, to add some context or make your forms look a little better, you may want to add a background color or an image to your form. Let's go over the three easy steps it takes to get the job done.

Use case


In this example, we have a New Order form, and we'd like to add the company's logo to it, to help establish better brand recall and create an association with our customers.

Application flow


1Create the New Order form which will help customers place orders.
2. Create a page using HTML snippets to embed the form. 
3. Use CSS code to add the background image.

Here are some quick steps to add background images to your form from scratch:



Step 1: Create the New Order form, with all the required fields

Here are the fields on the order form:
  • Sales Owner (Lookup field)

  • Customer (Dropdown field)

  • Order Date (Date field)

  • Delivery Agency (Dropdown field)

  • Estimated Delivery date (Date field)

  • Product (Dropdown field)

  • Quantity (Number field)

  • Sub Total (Currency field)

  • Tax (Percentage field)

  • Net Total (Currency field)



Step 2: Create a page and add an HTML snippet to it

 

We need to embed the form into a page, so that we can add the required styling elements we need. All you need to do is 
drag and drop the HTML snippet onto the page, then add the following code to it:
  1. <div elName='zc-component' formLinkName='Order'
  2. params='zc_Header=false&amp;zc_SuccMsg=Data Added
  3. Successfully!&amp;zc_SubmitVal=Submit&amp;zc_ResetVal=Reset'>Loading Form...</div>
Here "Order" is the form link name of the form. You could also embed the form into the iframe using iframe HTML tags. 



Step 3: Paste the CSS code into the HTML snippet


We need to use CSS to specify aspects like size and typeface for the fonts, colors for the text and backgrounds, alignment of the images, add space between  a border to the elements, and more.
 
You can use the following CSS code to add the background image:

  1. <style>

  2. .zcform_FormLinkName .formContainer {
  3. background-image:url(<Image URL>);
  4. background-size:cover;
  5. <\style>


In this code:


FormLinkName: Form name as per in the form's URL.
Image URL: A public URL of the image you want to display in the form's background

Note
  • You can customize the size of the background image with the "background-size" CSS styling.

  • Use a single white-space character between the form link name and .formContainer—it's important to make this CSS styling work.

  • Please avoid using this property when there are subforms or any hidden fields in the form, as it increases the form's height based on added subform rows, which results in enlarging the background image automatically.

Given below is how this page will look:



Easy, right? You should give it a try! If you face any difficulties while adding an image to your forms, please comment below and we'll be happy to assist you.


2 users like this announcement.
17 Replies
Reply
  • 4 years ago

Hi Sejal,
very practical tip. How can we set the background color in cells?

  • 4 years ago

Hi Gregory,

Thank you. We are glad the tip was helpful to you.

Are you referring to applying the background color to the cells(records) in a report? If yes, please use the conditional formatting to achieve it.

Please refer this link: https://www.zoho.com/creator/newhelp/reports/define-formatting-rule-field-list-report.html

  • 4 years ago

Thank you very much. I forgot about this obvious possibility ...

  • 4 years ago

Hope you were able to add color to your records. If you have any topic in mind that we can do a post on, please feel free to share it.

  • 4 years ago

I tried to set background image but how to call form name into <style>. any example please

  • 4 years ago

Hi Krishnaa,

The exact line to call the form name inside the style would be ".zcform_FormLinkName .formContainer"
For instance, if the form link name is "Orders" then the Css would be ".zcform_Orders .formContainer"

Feel free to drop an email to support[at]zohocreator[dot]com, if you have further concerns about this tip.

Hope this helped!

  • Creator Certified Business User
  • 4 years ago

Hi, great tip, can this be used for charts? how would I add an image background to a scatter (x,y) chart?

Thanks in advance!

  • 4 years ago

Hello,

Thank you!

Unfortunately, we do not have an option to embed a background image in both Pivot charts and inbuilt Chart option in pages.

Feel free to drop an email to support[at]zohocreator[dot]com, if you have further concerns about this tip.

  • 4 years ago

This is the error I'm having I created workflows to add deposit and withrawal but I have the same problem over and over again when I try to create a different project

Screenshot_20200715-005858.png
Screenshot_20200715-005858.png92 KB
  • Zoho MVP
  • 4 years ago

The collection variable "getRecord" is returning no results and therefore it's failing when trying to update it. Try check if it exists first like:
  1. //fetch record
  2. getRecord = Form_Name[ID != 0];
  3. //check if
  4. if getRecord.count() > 0
  5. {
  6.       //update record
  7.       getRecord.Field_Name = "Something";
  8. }

  • 4 years ago

its showing url not found
please give syntax to paste image url

  • 4 years ago

Hi Roopa,

The <Image URL> can be any published image URL of an image that you need to display in the background of the form. And if you have the image file and need to convert it into a published image URL, please try any third-party websites from the internet to achieve it.

Feel free to drop an email to support[at]zohocreator[dot]com, if you have further concerns about this tip.

Thanks.

  • 2 years ago

Thanks for this. Can I embed a search box into a HTML snippet, and can I use CSS to style the search box? I would like to adjust the width of the searchbox, and have it embeeded into the same html snippet as my report.

Thanks!

  • Zoho MVP
  • 2 years ago

I don't think it's possible to embed the search element into a HTML snippet, however it is possible to <div> embed a stateless form with a single line text field and control it's width and height. You would need to add your own deluge script to mimic the search capability.

  • 1 year ago

I'm following your instructions but the form only shows up while editing the Application, if I publish the page  a 'Loading the form...' message shows for a few seconds and then nothing. What has to be done for the form and background image to show up when the page is published?

  • 1 year ago

Just insert &amp;privateLink=<Published_Key> as parameter where <Published_Key> is the URL ending from publishing the form, not the page.
  1. <%{%>
  2. <div elName='zc-component' formLinkName='form_link_name' params='zc_Header=false&amp;zc_SuccMsg=Data Added Successfully!&amp;zc_SubmitVal=Submit&amp;zc_ResetVal=Reset&amp;privateLink=<Published_Key>'>Loading Form...</div>
  3. <%}%>


Hello Team,

It comes in quite handy for this. and I followed your directions to generate the background image.


Thanks & Reagards,
Thisai.

Reply to Sejal DattaniA
/* */
  • 12
  • Insert
  • Plain text
Add Comment
(Up to 20 MB )
    Stats
    5 followers
    17 replies
    8964 views
    Follow

    Subscribe to receive notifications from this topic.