Hitting return

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

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

Hitting return

#1

Postby Steve James » Thu Jun 15, 2017 2:31 pm

In forms if a user hits the return key Ebase interprets this as clicking the first button on the form.

Is there a way to disable this functionality/feature?



Thanks
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Thu Jun 15, 2017 3:31 pm

0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#3

Postby Steve James » Fri Jun 16, 2017 9:11 am

Thanks Jon, it'll be worth disabling on a few pages, especially where it is a read only / search type page.
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#4

Postby Steve James » Fri Jun 23, 2017 9:01 am

Hi Jon.

I've quickly done a bit more digging on this and created a rough and ready test form. We use buttons to navigate back to a menu/home page.

removed will not work! https://bradmobdev.bradford.gov.uk/ufs/returntest.eb

4 tabs
1 - expected behaviour, the button above the fields is a simple html button when I hit return I either get whinges that the mandatory fields are not populated or the Ebase event fires (add message to the event owner)

2 - expected behaviour, the button above the fields is html submit button when I hit return the event fires and a simple alert appears ie the submit action is fired.

3 - unexpected behaviour. This time I have an Ebase image with an onclick event. If I enter info in the text field I would expect the behaviour to the same as the first tab, ie the image is only an onclick not a submit.

4 - unexpected behaviour. This time I have an Ebase button with an onclick event. If I enter info in the text field I would expect the behaviour to the same as the first tab, ie it is only a simple button, not a submit.

Does this make sense?

Thanks
Last edited by Steve James on Mon Jun 26, 2017 1:04 pm, edited 1 time in total.
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#5

Postby Steve » Mon Jun 26, 2017 9:21 am

Hi Steve,

I think I understand. I believe that you are not expecting the image event to fire when you click return on tabs 3 and 4, and you'd expect the "Event" button to fire as this is below the entered fields, or the validation event to fire if no data is entered?

Can you send your form to support@ebasetech.com so that I can inspect the form.

Steve
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#6

Postby Steve James » Mon Jun 26, 2017 9:42 am

Hi Steve. I've sent the form.

I think it is easier to describe it as I'd like the ability to have Ebase objects (img;buttons etc) that do 'not fire' in the event of the return key being pressed.

Thanks
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#7

Postby Steve James » Mon Jun 26, 2017 1:07 pm

There is a way of doing this, it is easier for images than buttons.

Instead of having an Ebase click event you can configure the click on ‘html event properties’ ie do not have a server side on click event

Now the event only occurs if the user physically clicks on an image, put in a client callable script to handle the logic.

All Ebase buttons are submit so if required add an extra html event properties to change the type of the button from submit to button eg $("#btn").prop("type", "button");

More cumbersome so I don't think we'll try this approach but the image one should work ok.
0 x


Who is online

Users browsing this forum: Google [Bot] and 11 guests