This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Label with 2 input fields??


  1. webcommerce
    Member

    I want to create a label that says How old are you: with two inputs 'years' and 'months'. Is it possible to do this?

    I realise it can be done with two separate text fields but it isn't very elegant.

    I looked at changing the Name Field but (other than doing it globally with languages.php) I can't see how it's possible.

    If it can't be done, can I suggest it would be a good future added feature.

    Ron S

    Posted 16 years ago #
  2. redityo

    hmmm maybe with some trick it possible, I try it with some element with details :

    - section break : element_3
    - year : element_1
    - month : element_2

    ater that you can edit your CSS form and add these code :

    #li_1
    {
     float: left;
     width:15%;
     clear:both;
    }
    
    #li_1 label
    {
     float: left;
     width:32%;
     clear:both;
    }
    
    #li_2
    {
    float:left;
    width:20%;
    }
    
    #li_2 label
    {
     float: left;
     width:40%;
     clear:both;
    }
    
    #li_3 h3
    {
    border-top:none !important;
    font-weight:bold !important;
    font-size:98% !important;
    }
    
    #li_3
    {
    border-top:none !important;
    }
    
    #li_4
    {
    clear:both;
    }

    You can mention there is "li_4" rules, it's use give line break for next element after year/month modification. I hope this is what you mean :)


    MachForm Support

    Posted 16 years ago #
  3. webcommerce
    Member

    Thanks to redityo.
    (As usual) excellent advice ...

    I tried your code on another form but I couldn't get it to do what I want.
    Probably it's not possible with the current form format when mixing section break and other text fields.

    What I would like to see is another field as part of the standard form building set similar to the name field with the ability to size the two sub fields and name them. Maybe this is possible in another software update??

    The style has many possible uses, like How old are you/years/months, How long have you lived at this address/years/months, How long is this object?/feet/inches, How tall are you?/feet/inches,Insert parts code/alpha/number, etc

    The main advantage I see is that it would group the Header with fields more logically (closely?) which I can't get using current process. Plus it would show on printout of the data entry, which isn't happening now.

    Regards,
    Ron S

    Posted 16 years ago #
  4. yuniar

    Hello Ron,

    Thank you for your suggestion.
    Currently, it's not possible to do it perfectly indeed.

    The above hack won't show on printout of the data entry either.
    I've noted your request. Thanks again.


    MachForm Founder

    Posted 16 years ago #

RSS feed for this topic

Reply