Centering A Form Using DIV

  • Profile Image
    Barkley
    Asked on July 02, 2013 at 09:17 AM

    If you click on "Free Changes" you will see what Iam trying to accomplish in the included URL

    I have to copy jotform source code into my web page so I can include the following java script in my web page:

    <body>

    <!-- ******** BEGIN LIKNO WEB MODAL WINDOWS CODE FOR LMStoreWindow ******** -->

    <script type="text/javascript">var lwmwLinkedBy="LiknoWebModalWindows [1]",lwmwName="LMStoreWindow",lwmwBN="260";</script><script charset="UTF-8" src="//www.foxmls.com/likno-scripts/LMStoreWindow.js" type="text/javascript"></script>

    <!-- ******** END LIKNO WEB MODAL WINDOWS CODE FOR LMStoreWindow ******** -->

    I have tried to center the form, not the text, with:  <div style="width:100%; margin: 0 auto;"> but it does not work.
    I cannot use Iframe as I have no way of injecting my javascript into the Jotform page.
    Any suggestions?
  • Profile Image
    jefreylandicho
    Answered on July 02, 2013 at 09:33 AM

    The div style should be 700px not 100% as when you used 100%, the div size will occupy the entire space.

     

    <div style="width:700px; margin: 0 auto;"> or <div style="max-width: 700px; width:100%; margin: 0 auto;">
     

     

    If you need further assistance, please contact us again

  • Profile Image
    Barkley
    Answered on July 02, 2013 at 09:55 AM
    Thank you.

  • Profile Image
    Barkley
    Answered on July 02, 2013 at 09:57 AM
    Is there any method to insert javascript into a form?


  • Profile Image
    sidharth_kch
    Answered on July 02, 2013 at 10:07 AM

    @Barkley

    Unfortunately, you can't add javascript code within JotForm editor. If you need to add javascript code to your form, the only option is to download your form's source code and add the javascript code.

    Please refer this guide: How to get your Form Source Code

    Let us know if you need further assistance.

    Thanks,

    Sidharth