Redirecting the form

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

sudjain
Ebase User
Posts: 8
Joined: Fri Jul 24, 2009 4:02 am

Redirecting the form

#1

Postby sudjain » Tue Jun 01, 2010 1:17 pm

I want the current form to redirect to the other form when a particular field is selected.However i want an intermediate form should be displayed which displayes the message to the user 'Page is redirecting to x form in y seconds'.
I can redirect the form to the intermediate form by calling the script call form and pass the parameters , but how i should make the intermediate page to resubmit automatically after y seconds so that i can trigger the script on 'Before Page' event?
Or is there any other way ?
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#2

Postby Wai » Wed Jun 02, 2010 2:19 pm

On your intermediate form you can use the meta redirect HTML tag, also known as meta refresh.

This can be used to redirect to a URL, specify the URL to the new form. If you need to pass parameters, you can potentially store them in the browser session.

For example:

Redirect to yourdomain.com after 5 seconds:

<meta http-equiv="refresh" content="5;url=http://yourdomain.com"/>

In Ebase, you define the meta tag in the Form's maintain form level metadata icon on the form (fourth icon from the right)

Alternatively, use Javascript to display a message and after so many seconds, redirect to the form. This is probably the more elegant approach.

Hope that helps.
0 x

ccc_ar
Ebase User
Posts: 8
Joined: Wed Mar 20, 2013 9:25 am
Location: Carmarthen, UK
Contact:

#3

Postby ccc_ar » Fri Jun 14, 2013 7:56 am

Hi,

This nearly answers my question also. However, instead of redirecting to a new form (or URL)

a. We just want to trigger a script without user interaction and/or
b. Redirect to another page without user interaction.
0 x

ccc_ar
Ebase User
Posts: 8
Joined: Wed Mar 20, 2013 9:25 am
Location: Carmarthen, UK
Contact:

#4

Postby ccc_ar » Fri Jun 14, 2013 11:02 am

OK,

I've got a little further but have a couple of queries which may get to a resolution.

I've used the html++ to add javascript to the page header. I now have the flexibility of full javascript. I simply set a timeout to run scripts.

Problem -> How do I now access an ebase javascript from this javascript?
Is there a specific way to do a call? An example would be ideal. Also on another note, can I access the variables on the page from a script within html++?
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#5

Postby Wai » Fri Jun 14, 2013 12:13 pm

Using JQuery you can trigger a button click on the page and also get field values.

1) Trigger button click
Button on page (which can be hidden or not using display: none) has a locator (e.g ID or class) in HTML Element Properties

client side function script
function updateFormTrigger(){
$('#myButtonID').trigger('click');
}

When the button is triggered it will run the server side script attached to the button

2) Get field values from fields on page
Place locator on the HTML Element Properties (ID or Class).

var myfield = $('#myfieldId').val();
0 x

ccc_ar
Ebase User
Posts: 8
Joined: Wed Mar 20, 2013 9:25 am
Location: Carmarthen, UK
Contact:

#6

Postby ccc_ar » Fri Jun 14, 2013 12:54 pm

Thank you very much. I have got it working.

Simply added a button to the form, via HTML properties gave it an ID.

Under html++ on the page, added my timeout that achieved a button click and it worked a treat.

Minor thing, I used javascript code instead of jquery code for the button click. Not sure why jquery code did not work.
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#7

Postby Wai » Fri Jun 14, 2013 1:04 pm

Hi,

Hard to say why it didn't work without looking at your form. There may have been JavaScript errors perhaps?

Great that you got it to work with just JavaScript.
0 x


Who is online

Users browsing this forum: No registered users and 19 guests