Jump to content
  • 0

Transfer Value From One Data Page (Form) To Another Before Submit Form


Dev

Question

Hi 

 

have stuck with a problem of transfer value generated via javascript in html block of one form (lets say form A) to another data page (also form, lets say form B) before submitting form A.

 

Value transfer via parameter in link 

 

i.e   AppKey=somekeynumber&OrderID=[@field:OrderID] when B form is opening.

 

OrderID is generated value via html block. OrderID is saved into A table as id after A form submit.

 

The problem is that form B receive previously generated value as the on load parameter from last submit value of the form A.

 

However I need current generated value, not previously submitted.

 

Any ideas how to do/resolve this? 

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi Dev,

 

Welcome to the forum!

 

It's rather strange workflow for me, but I think you can use the following idea:

<script>
document.write("<a href='URL?AppKey=somekeynumber&OrderID="+document.getElementById("InsertRecordOrderID").value+"'>Click me</a>");
</script>

Your script generates some ID and writes it to the OrderID field, is it correct?
Then write the link in the HTML Block, use "document.getElementById("InsertRecordOrderID").value" instead of "[@field:OrderID]".

 

Does it work for you?

Link to comment
Share on other sites

  • 0

Hi Xiang thank you kindly for your response. Figured the problem. The id  was not assign properly to the element, element was empty.

 

It works both with [@field:OrderID] and document.getElementById("InsertRecordOrderID")

 

 

I have another question. Is it possible to check in some way all the fields before submitting form?

 

Some kind of confirmation page with all data from multy forms ( possibly with edit f), If data ok, form is submitted,  if not cancel.

 

Thnank you!

Link to comment
Share on other sites

  • 0

Hi Dev,

 

You can use a "virtual" Submission form, so a user enters all data to Virtual fields. When the user clicks "Submit", parameters are passed to the second form.

The second form is the "real" form, fields get parameters on load, and then you can disable all fields. If a user clicks Submit, the data are added to the table. You can add an HTML Block with the "Back" link, that will pass all parameters back to the Virtual form.

 

Or you can use Update Forms. Something like

http://howto.caspio.com/tech-tips-and-articles/common-customizations/how-to-create-a-multi-page-form/
Then when a user clicks the "Submit", some checkbox is checked and the record is displayed.

 

I hope it helps :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...