We are using Orbeon forms version 2017.1.1, and we are trying to trigger validation of the current field in the form on each keyup JS event. We have tried using ev:event="xxforms-value-changed" but it only fires after the field has "blurred". Is there a way to trigger the validation on keyup event using XML?
You can get the value to be updated as users type, without waiting for users to press enter, or for the field to loose the focus, by adding the incremental="true" attribute on your <xf:input>. This isn't the default as it creates more chatter between the browser and the server, as well as more load on the server, and often isn't necessary.
Related
I am using the Remote Validation attribute on my domain model, to call an Action that returns Json. This validation occurs on a checkbox and it only kicks in when the form is submitted. I'd like it to act the same way that text boxes remote validation works. As soon as it looses focus, remote validation kick in. Or perhaps on click.
These are screen shots from a test project. The actual project is too busy, that's why I created this sample one.
I'd love to see some suggestions that do not involve using JQUERY in the view. But if that's the only way then be it.
Thank you.
MODEL:
Both properties have the same Remote validation, because I wanted to test if the loosing of focus would trigger the text box to validate, and indeed, it worked. I assumed that the same would happen for the check box, perhaps on click, or loosing focus, but no. Only when I click create the IsNameDuplicate() is called.
CONTROLLER:
VIEW:
I am using ng:Disabled directive for disabling my submit button. Its working fine its not enabling until all the required input fields are getting filled, but when I am inspecting the element using Google chrome firebug console and manually delete the disabled attribute from submit button then its get "Enabled" and form is submitted. So my question is that how to handle this type of problem. There are any option to checking validate from controller and enable/disable submit button from controller.
Please give me some suggestion for this.
Basically I am referring this url: http://docs.angularjs.org/api/ng.directive:ngDisabled
Ensure your form doesn't have an action attribute, and hook up
the ng-submit
directive of the form element or the
ng-click
directive on the first button or input field of type submit.
See form for more details.
From that event handler you can perform additional validations and send form only if validation is OK or show an error otherwise.
I am trying to create a web form in Lotus Notes that is web enabled. So far this has all worked fine, however there are 2 issues.
When Creating a Java Script Alert in the OnLoad Event, it Pops up everytime a user selects a radio button or dropdown option since this reloads the page. Is there any way to make this only for the initial opening of the form?
When a user selects an option, the form reloads and puts that form field on the top which is proving to be very disorrienting for users. Is there a way to have it not scroll on reload?
Thanks in advance!
The best advice would be: use XPages for web development that is "state of the art". If you can't, you have to code a lot of JavaScript to make the form not behave like "havoc".
First of all: the field property "refresh fields on keyword change" is the reason for the jumping / reload.
What does domino do?
All events / formulas that occur when you normally press F9 or use the Option above (that can be field values, input translations, hide whens, etc.) are not "converted" to HTML and javascript but are executed by the server. Therefor each change in a field with the option set submits the form and adds an &Seq=x to the url to keep track of the state. X increments on every reload. Of course this reload causes all events to be triggered again.
For you this means:
Option
disable the option to reload the form after keyword change.
Unfortunately you have to recode every dependency / calculation / hide when with javascript. Using a framework like jquery or dojo this is possible, but a lot of work.
If there IS no dependency then just disable the option...
Option
Live with the "jumping" and let your onload event check for the existance of an URL- parameter called seq... And only if it does not exist, then it is a "real" OnLoad...
Both options are not quite nice and not very easy to code...
That's one reason why IBM started XPages... There all this stuff is already handled by default...
Up to this point, I’ve been using Microsoft Ajax for updates in my MVC app. I’m now switching to jQuery Ajax in order to standardize my approach.
However, I just realized that the required field in my model for the form did not fire and the user was able to submit the form even though some required fields were left blank.
What is the standard way to handle required fields if I’m handling my ajax functions using jQuery – i.e. I want the unobtrusive to handle my required fields by highlighting them and not allow the submit button to be clicked.
Also, to mention I am getting data-val attributes through the model.
P.S. I’m now using an event handler to detect click event on submit button for the form. In other words, I’m not using #using.Ajax.BeginForm to define my form.
I'm familiar with the method of submitting a form via a change event like or a checkbox's check event. Most articles explain how to find the first form using jQuery and invoke it's submit() method. However, I wish to submit the form but not cause validation so the back-end can perform other actions. In my case, I have a dropdown that a users changes. Depending on the value, the back-end adds/removes certain controls. The issue I'm runing into is that the validation prevents the form from submitting.
Q: How do I submit the form so it does not perform client-side validation?
Remove the validation just before the form is submitted - check out the answers here How do I remove jQuery validation from a form?
I think you can just turn the validation off by calling #Html.EnableClientValidation(false)