11
Views
9
Comments
Solved
stop submission without using form validation
Question

My application is traditional web (Dublin Template).

I have used the popup editor to fill in the data without form control. When i click the 'Save' button, it will perform the input validation. If the validation is failed, it will set the input field to be invalid, reload the container and set the invalid input focus. But the popup editor will be reloaded at the end. Then, it will clear my input data. How can i prevent the popup editor to be reloaded?

Thank in advance






mvp_badge
MVP
Rank: #91
Solution

Jessica Lee wrote:

If the popup editor is served for creating new records, the input value will be kept when validation is failed.

However, it will restore the initial data if editing the existing records when validation is failed. Since it will re-execute the 'preparation'


If

Hi Jessica,

I guess, I successfully reproduced the same scenario which you have implemented... Things to check

1) Set Save button Method Type to Ajax Submit

2) Set Save button Validation to Client & Server

3) Define a Ajax node before  the Input_FoucsFirstInvalid Server action, refreshing the parent container which encapsulates all the input controls and button.

see this Sample App

Implemented Validations: Department > 2 char, Name > 5 char

Hope this helps you!


Regards,

Benjith Sam

 

mvp_badge
MVP
Rank: #64

Hi Jessica,

I suspect your Save button's method in your popup is Submit , try to make it Ajax Submit and see if it is working accordingly or not.


Regards,

-PJ-

mvp_badge
MVP
Rank: #91

Hi Jessica,

I reproduced the mentioned scenario in a sample app and I observed that even though the validation is failed the Input value is retained on the click of Popup Save button.

If possible could you please share the same .oml file for us to understand the case much better...


Regards,

Benjith Sam

Rank: #930

Thank Benjith

May i have screenshot for step 3 how to implement it?

Thank a lot.

Rank: #930

Hi Benjith,

It works. 

Thank a lot.