Discussions

Expand all | Collapse all

How do I create several buttons that each open different parts of the same form?

  • 1.  How do I create several buttons that each open different parts of the same form?

    Posted 06-19-2018 13:57
    I have one form that contains lots of fields from various tables.  I want to be able to have 4 buttons (New Show, New Rental, New Community Event, New Film) that will each open certain fields depending on the button.  Much of the info needed for each type is the same so I didn't want to create different forms for each.  Thanks.


  • 2.  RE: How do I create several buttons that each open different parts of the same form?

    Posted 06-19-2018 14:56
    I agree with having 1 form and using form rules.

    In View mode you can use an API to check certain fields and then refresh the record.


    var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord"
    & "&_fid_100=0" // uncheck field ID 100
    & "&_fid_101=1"; // check field ID 101


    "javascript:" &
    "$.get('" & 
    $URL & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);"

    So the first part defines a formula variable called URL to edit some fields on the record, and then that javascript stuff simply run the URL and refreshes the page.  Don't worry that you do not understand the javascript stuff.  Almost "nobody does"  It just works.

    The trick is to always call you formula variable URL and then use URL in the middle line in the javascript.

    here is some help on formula variables if you have never used them

    https://help.quickbase.com/user-assistance/formula_variables.html


  • 3.  RE: How do I create several buttons that each open different parts of the same form?

    Top
    Contributor
    Posted 06-19-2018 15:06
    >Don't worry that you do not understand the javascript stuff.  Almost "nobody does"  It just works.

    I am launching a new program called Know Code™ as a remedial measure.


  • 4.  RE: How do I create several buttons that each open different parts of the same form?

    Posted 06-19-2018 15:26
    I know it's your dream to have everyone know at least javascript 101.