PDA

View Full Version : how to validate textfields using validation summary as alert box/Message box



sunshineenterprises
Jul 09, 2014, 2:04 PM
i have two text fields, and those two fields are mandatory, i need to use validation summary to pop out the mandatory fields as an alert message,
can any one tell me how to display it. or please suggest me some solutions to get validation on using alert/popup message.

i dont want to use validations in examples on ext.net

Daniil
Jul 09, 2014, 3:29 PM
Hi @sunshineenterprises,

You can validate the fields manually if needed, like

if (field1.getValue() === "" || field2.getValue() === "") {
Ext.Msg.alert("Error", "The fields are mandatory.");
}

sunshineenterprises
Jul 09, 2014, 4:05 PM
is it applicable for client side? i am trying out for client side validation using validation summary, is it possible to work with validation summary, can you please give me an example to use validation summary

Thanks Daniil

Daniil
Jul 09, 2014, 6:32 PM
can you please give me an example to use validation summary

I am not sure how it should look. Is there any screenshots or links demonstrating the functionality that you need?

sunshineenterprises
Jul 10, 2014, 6:17 AM
Please find the attachment, i get this done on controller, but i want this to be done on client side(razor view page)

Daniil
Jul 10, 2014, 2:06 PM
So, does my suggestion in the post #2 not help?

sunshineenterprises
Jul 11, 2014, 6:37 AM
i meant to get the code like this in the link


http://asp-net-example.blogspot.in/2008/10/validationsummary-example-how-to-use.html (http://asp-net-example.blogspot.in/2008/10/validationsummary-example-how-to-use.html)

i haven't tried the example you provided in the post 2, is that to be used in the listener? kindly assist, this is my first try with ext.net

Daniil
Jul 11, 2014, 4:20 PM
There is no a direct analog of ValidationSummary. There is a thread discussing possible alternatives.
http://forums.ext.net/showthread.php?24928


i haven't tried the example you provided in the post 2, is that to be used in the listener?

It is a JavaScript code. You can run it when needed.