Hi There,
I have a button on a web form. When I click the button on this form I would like to pass a value from the form into the next webform.
Is there anyway of doing this?
Thanks
Jamie.
Hi There,
I have a button on a web form. When I click the button on this form I would like to pass a value from the form into the next webform.
Is there anyway of doing this?
Thanks
Jamie.
Subject: Pass a value from one web form to another
Please provide more information about your process. In particular, define what you mean by the “next webform”. What, exactly, happens when you submit the first document. Do you want all values to be passed to the new document (making a copy of it) or just one or a few values. Do the two documents use the same form? There are several ways of doing this, but which one works best for you depends on what you’re trying to do.
Subject: RE: Pass a value from one web form to another
Hi Joel,
Thanks for your response. Hope the following description helps you help me! :
I have a webform (form1) with a command button on it. When i click this button it runs a simple @Command([Compose]) statement (to a different form(form 2)). What i would like to do is to pass a value from form1 into the form2 when i click this button.
I hope this makes it clearer. Thanks very much for your help.
F1H
Subject: RE: Pass a value from one web form to another
Probably the simplist way to do this would be to check the “Formulas Inherit Values from Selected Document” box on the form properties of the INERHITING form. Then, in the field you wish to store the value on this new document give it a default value (or value if it is computed) that is the field name of the field you are inheriting from the other form. Make sure to hide your compose button that resides on the main form if it is a new document (unless you wish to create the other document anyway, with no inherited data).
I have tested that this will work. If you are using javascript for your button, this will work in place of the compose command:
var form = frm.form.value;
var newdocpath = “/” + g_dbname + “/” + form + “?OpenForm&ParentUNID=” + g_docunid;
var child = window.location.replace(newdocpath);
As you can see, there is a field on the form in my database called form, but you can hardcode this. the variables i used for g_bname and g_docunid were created in the html header using @functions to get this information, but however you prefer to do it works just fine. The important part is that you have the ParentUNID parameter and that the receiving form field has default values set correctly for the fields you are passing.