Forums

Alternative to event loop?

chriso0258 13 Aug, 2015
Hello,

I have a multipage form which I'll call 1a and 1b. After a user completes 1a, the data is saved and the user is taken to 1b. I have written some custom form validation and have used an event loop in other forms to reload the page if the validation fails. However, in this case, when the page is reloaded, it takes the user back to 1a. Since this data has already been saved, when the user clicks next to go to 1b, they get a message saying that data has already been used (which is what should happen).

Is there a way to either,
1. just reload page 1b or
2. If I have to create a separate form (call it 2) then how would I then send the user to form 2 after they submit form 1?

Hope this makes some sense.

Thanks for your help.
Chris
GreyHead 13 Aug, 2015
Hi Chris,

You can change the event in the Event Loop action to point to the event that loads form_1b - does that help? (Just make sure that it does not point the event it is in or you get an infinite loop.)

Bob
chriso0258 13 Aug, 2015
Hello Bob,

Thanks for your reply. It makes sense. How would that look in the event loop? The HTML render for 1a has a 2 in the Page box. Would the event loop then show load 2, load:2, load Page 2? How would I format that?

Thanks.
Chris
GreyHead 13 Aug, 2015
Hi Chris,

The Event Loop action loads an event - the basic ones are load and submit. You can have the submit event loading page 2 or you may have added a new one. What you need is the name of the event holding the HTML (Render form) action that loads the page.

Bob
chriso0258 14 Aug, 2015
Hello Bob, thanks for your reply.

I did what I think you asked and didn't have any success. Maybe I'm not understanding you. Here are some pictures.

The onLoad HTML render form looks like this:
[attachment=0]onLoad-HTML_Render_Form.jpg[/attachment]

When this is submitted, it saves the page 1 data to the equipment table because I need the equipment id for the location table which is the information on page2. The page2 HTML render form looks like this:
[attachment=1]page2-HTML_Render_Form.jpg[/attachment]
When page 2 is submitted it should save the data in the locations table. Now, if one of the fields in page 2 fails validation, I'm trying to get page 2 to reload.

I've tried putting the following in the event loop:
1. I've put in 'load' which takes me back to page 1.
2. I put in page2 but it tries to save the data again from page 1 so I get my message that that information has already been saved. No form is displayed.
3. I've also tried putting in 'submit' and the browser just loops and no form comes up.
4. I've tried putting in just a 2 but no page is reloaded.

Am I doing something wrong or should I look at some other method?

Thanks for your help.
Chris
This topic is locked and no more replies can be posted.