custom data validation in angular 4 - forms

i'm using my angular 4 app as a frontend application using web services .
i have a component that showing form user details . so to validate my form i have a one cretaria is all full inputs (user information) that was imported from the web services is required .
for exemple if have username and telephone inputs showing in my updatecomponent and the username are 'xxxxxxx' and telephone is empty , if i try to clean the username input and submit the form , it should not submitted because the username was not empty from the backend and i have to mention like a warning to fill the username input for submit the form . and for the telephone input , there is no problem , because the input came empty from the start .
so what kind of validation form may i do ?

You can use form validation.
This article can helps you:
https://angular.io/docs/ts/latest/cookbook/form-validation.html

Related

How to populate fields of an online form

I created a custom record (child of Inventory item) and an online form.
The final goal it's to send a link to a user (not a netsuite user) to display the different informations of this custom record. The user will be able to update some values and submit the form.
I saw it's possible to link a script file to this form, but I need the ID of the record to load it and populate every field of the form.
With normal forms, we have the internalid of the record as an URL param but in this case there is nothing in the URL .
Do you know any way to achieve that ?
A solution for the final goal could be:
Create an empty Suitelet (provides external link for User). Or refer to step 4 for contents.
Stored on the Custom record or via script (created in step 3) you can add to the external link, to include the record type and id as url parameters (&recordtype=customrecord&recid=12345). Be sure to avoid reserved parameter names.
Create a UserEvent, Client, or Scheduled Script to send email to User based on your requirements (in the email include the custom external suitelet link). User will click on the link and land on a NetSuite looking webpage (not requiring credentials).
Modify empty Suitelet. Suitelet should when context.request.method===GET: get parameters, load record(s), get data from record(s), create form, display data to User, display fields for User to enter data, add submit and refresh/cancel button, write/display the form with all fields. Upon submission (when context.request.method is not GET) you can use record.submit method to update the custom record(s).
NetSuite Suite Answer Id 74607 has a Sample Custom Form Suitelet Script from that can be very helpful.

How to show single form validation error message for multiple form fields in codeigniter

I have a simple form which has only two(email, password) fields. I'm using codeigniter's form validation library to validate that form. And it's working fine, but not the way I wanted to.
I want to show only one error message when email or password field empty. or when both fields are empty. not two error messages for each fields.
How can I do that in codeigniter using it's form_validation library.
Use form_error() function http://www.codeigniter.com/user_guide/libraries/form_validation.html look up Showing Errors Individually

How to validate wicket form sequencly

I am new to wicket framework. currently i have a task to validate the form fields one by one (sequence). but By default Wicket shows error messages together in a one place in the form. I want the field to be validated sequential is there any components ? Or Please guide me in the right direction what i should do ?
For EX:
if i consider LoginPage which contains username,password with out entering anything if i submit the form . that should show first field username required even password not entered also. once i fill username next it should check password entered or not so like this sequential validation possible?
You can use a ComponentFeedbackMessageFilter to show feedback messages for each component separately.
Please read "Displaying feedback messages and filtering them":
https://ci.apache.org/projects/wicket/guide/6.x/guide/forms2.html#forms2_2

How to Pop-up,one form fields to other form in HTML

I've two html forms,one is user sign-in form and other is sign-up form,both adjacent each other in one page.Suppose a non-existing user tried to login in my application using some username and password,I'll show error message any how,but at the same time,entered username and password should filled automatically in signup form once error has been error occurred.By this I can reduce user effort by filling two fields,to implement this,how can I use HTML5 features ?
Using jQuery, on error, you could do a:
$('form2#username').val($('form1#username').val());
$('form2#password').val($('form1#password').val());
This will move all contents of "username" inside of "form1" to the "username" inside of "form2"

issue in Zend_Frame_ Select box validation in ajax call

i have created a country select box as
$country= new Zend_Form_Element_Select('country');
in my user registration form ..
While selecting an country an ajax call is send and getting the state list
by creating another select box
$state= new Zend_Form_Element_Select('state');
in another action say stateAction()
Problem is that when i tried to validate registration form in the POST action
i cant retrieve the value from state
$form = new Users_Form_Register();
eg as $userObjectDetails->statename=$form->getValue('state');
as a solution i added tried to added a dummy variable $state in Users_Form_Register();
add addElement($state),unfortunately during value is loaded by ajax call the state list issue occure during validation of the form
please suggest a solution for the above
Thank you
You could try validating with javascript. jQuery has a nice validation plugin that lets you attach the validator to the form ID and define the rules you want to validate.