Applying external style sheet to Infopath form 2007 - InfoPath Dev
in

InfoPath Dev

Applying external style sheet to Infopath form 2007

Last post 05-05-2010 12:17 PM by Mohamed Derhalli. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-02-2010 08:21 PM

    • Aditya
    • Top 200 Contributor
      Female
    • Joined on 01-27-2010
    • Sydney
    • Posts 59

    Applying external style sheet to Infopath form 2007

     can i apply CSS to a specific control like radiobutton in Infopath form Using External style sheet.If so ,please guide me how can i accomplish that.

    Thanks.

    Aditya,
    .Net programmer.
    Filed under:
  • 05-03-2010 02:46 AM In reply to

    Re: Applying external style sheet to Infopath form 2007

    You can do this using External Style Sheet. 1- Save your InfoPath form as source files to a destination folder, then in that folder make a new file, name it anything, for this case call it radiobuttons.css, open the CSS file and paste this:

     

    .xdBehavior_Boolean{
    background-color: red;

    }

     This is the name of the class that radio buttons use in InfoPath and we applied the red color to it.

    2- Now open the file with extension .xsl that has your view name, and put a link for your style sheet after the head tag <head>

    3- Open your InfoPath form, Select Tools Then Select Resource Files and upload the CSS file.

    save the form, re-open it and see tell me the results

     

    Mohamed Derhalli ||| SharePoint Specialist ||| http://path2sharepoint.com
  • 05-04-2010 05:04 PM In reply to

    • Aditya
    • Top 200 Contributor
      Female
    • Joined on 01-27-2010
    • Sydney
    • Posts 59

    Re: Applying external style sheet to Infopath form 2007

    Hi,Thanks for replying.I tried what ever u said.Nothing is showing in the form.Am i doing something wrong?

    Here is the how i included in css link in view1.xsl

    <head>
        <meta content="text/html" http-equiv="Content-Type"></meta>
        <link href="customCSS.CSS" type="text/css" ></link>
        <style controlStyle="controlStyle">@media screen    {    BODY{margin-left:21px;background-position:21px 0px;}    }   BODY{color:windowtext;background-color:window;layout-grid:none;}   .xdListItem {display:inline-block;width:100%;vertical-align:text-top;}  

     Here is the code in CSS file

    .xdBehavior_Boolean
    {
    background-color: red;
    }
    First i created the customcss.css file and then uploaded it using resource files.Then,opened view1.xsl and added link to the new css file.Saved it.Opened the mainfest file to see the changes.Nothing happened.

    Please guide me if i am wrong.

    Thanks,

    Aditya.

    Aditya,
    .Net programmer.
  • 05-05-2010 12:17 PM In reply to

    Re: Applying external style sheet to Infopath form 2007

    Try this on blank new form ..

    1- drag radio buttons to the form, make them 2.  

    2- save source files, close the form 

    3- create css in source files folder, put this in it :

    .xdBehavior_Boolean
    { background-color : black ;
    }

    save your css as test.css

    4-open view1.xsl, exactly after <head> tag put this :

    <link rel="stylesheet" type="text/css" href="test.css"/>

    save and close

    5-right click your manifest.xsf, click design, click upload text.css as resource file, save and close form , re-open manifest.xsf in design and see the results.

     

    Mohamed Derhalli ||| SharePoint Specialist ||| http://path2sharepoint.com
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.