Forum Discussion

TamiCampos's avatar
TamiCampos
Qrew Member
7 years ago

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

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.
  • 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
  • >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.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      I know it's your dream to have everyone know at least javascript 101.