No announcement yet.

[SOLVED] Preset a value in a blank form from a control

  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] Preset a value in a blank form from a control

    I created a control with a user and a password that redirect to a blank form. I want the user id to be passed to the form so that the user cannot change it.

    So far, I have the global variable [v_user] that is verified in the control then passed to the form. It is set as a session variable and type out in the control and session type in, in the form.
    I used Welcome [v_user] in the header to make sure the variable was passed on and it is the case.

    The problem is that in the form, the user_id is still blank and I want to avoid the user to be able to enter another id.
    I tried a where clause but since I want to perform an insert with the form and not a select, I think that is why it did not work, but I am still new to scriptcase and MySQL, so I'm not sure...

    Also, I used sc_apl_conf("form_temps", "start", "new"); in onApplicationInit in the form, so I think it may be interfering with the global variable but I'm not sure ???

    Any help would be greatly appreciated.

  • #2
    if your user_id is different from your [v_user] variable just pass it along as well.
    Go to the settings page for the field and locate the line 'Initial Value (type)' and set it to 'Definded Value'.
    A new line 'Initial Value' is shown where you enter your variable i.e. [v_user_id].
    To make sure it can't be changed by the user you can set the field to act as a label, set it to read only or even hide it if you want.



    • #3
      It works!
      Thank you very much for your help!