Page 1 of 1

why I make two field into one row but they are different size?

Posted: 2017-10-29 12:15
by Sai chi
I follow all steps from course "Organizing Long Forms into a horizontal layout"

https://gist.github.com/AppGiniCourse/d ... 9de3e4f51c

But the Field cannot be the same size, What is wrong?

the course said will be the same size. my code is

function Property_dv($selectedID, $memberInfo, &$html, &$args){
/* change the layout only if this is not the print preview */
if(isset($_REQUEST['dvprint_x'])) return;

ob_start(); ?>

<script>
$j(function(){
$j('fieldset.form-horizontal').removeClass('form-horizontal').addClass('form-inline');


})
</script>

<style>
@media (min-width: 768px){
.form-inline .form-group{
width: 48%;
margin-bottom: 0.75em;
vertical-align: top;
}
}
</style>

<?php
$new_layout = ob_get_contents();
ob_end_clean();

$html .= $new_layout;

Re: why I make two field into one row but they are different size?

Posted: 2017-10-29 15:29
by landinialejandro
hi, you need to add another class control like this

Code: Select all

           /* new code*/
                    .form-inline .form-control {
                    width: 90% !important;
		    }                   
		    /*end new code*/
your full code :

Code: Select all

if(isset($_REQUEST['dvprint_x'])) return;

                ob_start(); ?>

                <script>
                $j(function(){
                $j('fieldset.form-horizontal').removeClass('form-horizontal').addClass('form-inline');
                $j('fieldset.form-horizontal').removeClass('form-horizontal').addClass('form-inline');


                })
                </script>
                <style>
                @media (min-width: 768px){
                    
                    /* new code*/
                    .form-inline .form-control {
                    width: 90% !important;
}                   /*end new code*/

                    .form-inline .form-group{
                    width: 48%;
                    margin-bottom: 0.75em;
                    vertical-align: top;
                    }
                }
                </style>

                <?php
                $new_layout = ob_get_contents();
                ob_end_clean();

                $html .= $new_layout;

Re: why I make two field into one row but they are different size?

Posted: 2017-11-04 14:48
by Sai chi
Hi:

I just copy all of your code and post it, my system is no run at all?
I just copy all code from video and it runs in the video but not in my system, why?