Fast way for email, phone input validation
Hi there! I'm trying to implement input validation for email and phone fields. I'm struggling with gwt-validation framework. Is there any fast, simple way to do it? Thanks, Best regards -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/GEkNV0IJ_IMJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Fast way for email, phone input validation
salam there mohammad salah validate your phone create method validate your email --- // this method is email for examplem...@mm.com public static boolean isEmail(final String value) { boolean valid = true; if (value != null) { valid = value.matches(.+@.+\\.[a-z]+); if (value.contains( )) { valid = false; } } return valid; } --- // this method is email is not empty public static boolean isEmptyValue(final String value) { boolean valid = true; if (value == null) { return valid = false; } if (value.trim().equals()) { return valid = false; } return valid; } --- // this method is email min lenght public static boolean checkMinlength(final String value, final int minLength) { boolean valid = true; if (value != null) { if (value.length() minLength) { valid = false; } } return valid; } --- // this method is MaX length public static boolean checkMaXlength(final String value, final int maxLength) { boolean valid = true; if (value != null) { if (value.length() maxLength) { valid = false; } } return valid; } --- validate is Fone --- create varible public static final String RGEX_PHONE_ONLY = ^\\(?(\\d{3}-)\\)?(\\d{3}-)?(\\d{4})$; this varible validate to phone for example method --- //this method is Phone for example 111-111- is true. -111- is not true -- is not true 111-111-111 is not true and contune. this method . --- public static boolean isPhone(String value) { boolean valid = false; valid = value.matches(RGEX_PHONE_ONLY); if (valid) { valid = true; } return valid; } --- *Regard: Senior : Mohamed salah hasan Mobile :+20106594094 tel :+2024460320 Mail:mohamedhasanshaks...@gmail.com* -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Fast way for email, phone input validation
Thanks! Sent from my BlackBerry® wireless device -Original Message- From: mohamed salah mohamedhasanshaks...@gmail.com Sender: google-web-toolkit@googlegroups.com Date: Mon, 27 Jun 2011 13:42:39 To: google-web-toolkit@googlegroups.com Reply-To: google-web-toolkit@googlegroups.com Subject: Re: Fast way for email, phone input validation salam there mohammad salah validate your phone create method validate your email --- // this method is email for examplem...@mm.com public static boolean isEmail(final String value) { boolean valid = true; if (value != null) { valid = value.matches(.+@.+\\.[a-z]+); if (value.contains( )) { valid = false; } } return valid; } --- // this method is email is not empty public static boolean isEmptyValue(final String value) { boolean valid = true; if (value == null) { return valid = false; } if (value.trim().equals()) { return valid = false; } return valid; } --- // this method is email min lenght public static boolean checkMinlength(final String value, final int minLength) { boolean valid = true; if (value != null) { if (value.length() minLength) { valid = false; } } return valid; } --- // this method is MaX length public static boolean checkMaXlength(final String value, final int maxLength) { boolean valid = true; if (value != null) { if (value.length() maxLength) { valid = false; } } return valid; } --- validate is Fone --- create varible public static final String RGEX_PHONE_ONLY = ^\\(?(\\d{3}-)\\)?(\\d{3}-)?(\\d{4})$; this varible validate to phone for example method --- //this method is Phone for example 111-111- is true. -111- is not true -- is not true 111-111-111 is not true and contune. this method . --- public static boolean isPhone(String value) { boolean valid = false; valid = value.matches(RGEX_PHONE_ONLY); if (valid) { valid = true; } return valid; } --- *Regard: Senior : Mohamed salah hasan Mobile :+20106594094 tel :+2024460320 Mail:mohamedhasanshaks...@gmail.com* -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Fast way for email, phone input validation
On Mon, Jun 27, 2011 at 1:53 PM, marco.m.al...@gmail.com wrote: ** Thanks! Sent from my BlackBerry® wireless device -- *From: * mohamed salah mohamedhasanshaks...@gmail.com *Sender: * google-web-toolkit@googlegroups.com *Date: *Mon, 27 Jun 2011 13:42:39 +0200 *To: *google-web-toolkit@googlegroups.com *ReplyTo: * google-web-toolkit@googlegroups.com *Subject: *Re: Fast way for email, phone input validation salam there mohammad salah validate your phone create method validate your email --- // this method is email for examplem...@mm.com public static boolean isEmail(final String value) { boolean valid = true; if (value != null) { valid = value.matches(.+@.+\\.[a-z]+); if (value.contains( )) { valid = false; } } return valid; } --- // this method is email is not empty public static boolean isEmptyValue(final String value) { boolean valid = true; if (value == null) { return valid = false; } if (value.trim().equals()) { return valid = false; } return valid; } --- // this method is email min lenght public static boolean checkMinlength(final String value, final int minLength) { boolean valid = true; if (value != null) { if (value.length() minLength) { valid = false; } } return valid; } --- // this method is MaX length public static boolean checkMaXlength(final String value, final int maxLength) { boolean valid = true; if (value != null) { if (value.length() maxLength) { valid = false; } } return valid; } --- validate is Fone --- create varible public static final String RGEX_PHONE_ONLY = ^\\(?(\\d{3}-)\\)?(\\d{3}-)?(\\d{4})$; this varible validate to phone for example method --- //this method is Phone for example 111-111- is true. -111- is not true -- is not true 111-111-111 is not true and contune. this method . --- public static boolean isPhone(String value) { boolean valid = false; valid = value.matches(RGEX_PHONE_ONLY); if (valid) { valid = true; } return valid; } --- *Regard: Senior : Mohamed salah hasan Mobile :+20106594094 tel :+2024460320 Mail:mohamedhasanshaks...@gmail.com* -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- - not at all *Regard: Mohamed salah hasan Mobile :+20106594094 tel :+2024460320* -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Fast way for email, phone input validation
On Monday 27 Jun 2011, mohamed salah wrote: salam there mohammad salah validate your phone create method validate your email --- // this method is email for examplem...@mm.com public static boolean isEmail(final String value) { boolean valid = true; if (value != null) { valid = value.matches(.+@.+\\.[a-z]+); if (value.contains( )) { valid = false; } } return valid; } --- // this method is email is not empty public static boolean isEmptyValue(final String value) { boolean valid = true; if (value == null) { return valid = false; } if (value.trim().equals()) { return valid = false; } return valid; } --- // this method is email min lenght public static boolean checkMinlength(final String value, final int minLength) { boolean valid = true; if (value != null) { if (value.length() minLength) { valid = false; } } return valid; } --- // this method is MaX length public static boolean checkMaXlength(final String value, final int maxLength) { boolean valid = true; if (value != null) { if (value.length() maxLength) { valid = false; } } return valid; } --- validate is Fone --- create varible public static final String RGEX_PHONE_ONLY = ^\\(?(\\d{3}-)\\)?(\\d{3}-)?(\\d{4})$; this varible validate to phone for example method --- //this method is Phone for example 111-111- is true. -111- is not true -- is not true 111-111-111 is not true Note this is only valid for US phone numbers. It takes no account of country codes or other international phone formats. David and contune. this method . --- public static boolean isPhone(String value) { boolean valid = false; valid = value.matches(RGEX_PHONE_ONLY); if (valid) { valid = true; } return valid; } --- *Regard: Senior : Mohamed salah hasan Mobile :+20106594094 tel :+2024460320 Mail:mohamedhasanshaks...@gmail.com* -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Fast way for email, phone input validation
-- salaam it ok this method *is only valid for US phone numbers. It takes no account of country codes or other international phone formats. but this format is US phone format ok Possible change your format Depending on the phone number isA for example (1) **public static final String RGEX_PHONE_ONLY = ^\\(?(\\d{3}-)\\)?(\\d{3}-)?(\\d{4})$; is true 111-111- for example (2) **public static final String RGEX_PHONE_ONLY = ^\\(?(\\d{4}-)\\)?(\\d{4}-)?(\\d{3})$;* *is true --111 for example (3) **public static final String RGEX_PHONE_ONLY = ^\\(?(\\d{2}-)\\)?(\\d{3}-)?(\\d{4})$;* *is true 11-111- thanks mohammad salah Take Your Time Man * * *-- *Regard: Mohamed salah hasan Mobile :+20106594094 tel :+2024460320* -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Fast way for email, phone input validation
Thanks for the note. On Mon, Jun 27, 2011 at 1:31 PM, David Goodenough david.goodeno...@btconnect.com wrote: On Monday 27 Jun 2011, mohamed salah wrote: salam there mohammad salah validate your phone create method validate your email --- // this method is email for examplem...@mm.com public static boolean isEmail(final String value) { boolean valid = true; if (value != null) { valid = value.matches(.+@.+\\.[a-z]+); if (value.contains( )) { valid = false; } } return valid; } --- // this method is email is not empty public static boolean isEmptyValue(final String value) { boolean valid = true; if (value == null) { return valid = false; } if (value.trim().equals()) { return valid = false; } return valid; } --- // this method is email min lenght public static boolean checkMinlength(final String value, final int minLength) { boolean valid = true; if (value != null) { if (value.length() minLength) { valid = false; } } return valid; } --- // this method is MaX length public static boolean checkMaXlength(final String value, final int maxLength) { boolean valid = true; if (value != null) { if (value.length() maxLength) { valid = false; } } return valid; } --- validate is Fone --- create varible public static final String RGEX_PHONE_ONLY = ^\\(?(\\d{3}-)\\)?(\\d{3}-)?(\\d{4})$; this varible validate to phone for example method --- //this method is Phone for example 111-111- is true. -111- is not true -- is not true 111-111-111 is not true Note this is only valid for US phone numbers. It takes no account of country codes or other international phone formats. David and contune. this method . --- public static boolean isPhone(String value) { boolean valid = false; valid = value.matches(RGEX_PHONE_ONLY); if (valid) { valid = true; } return valid; } --- *Regard: Senior : Mohamed salah hasan Mobile :+20106594094 tel :+2024460320 Mail:mohamedhasanshaks...@gmail.com* -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- Marco Manteigas Alves tlm: 96 983 46 23 skype: marco.m.alves -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Any recommended input validation lib?
Thnaks. On 27 sep, 21:11, Andrew Pietsch andrew.piet...@gmail.com wrote: Hi there, thanks for your compliments about pectin. Just as a matter of interest I've started talking with the author of Bindgen (http://bindgen.org/) about the possibilities of using it with pectin and things are looking promising. If we can get it working (and I think we can) you'll be able to create meta models using type safe code completed bindings generated from your bean graph. e.g. fieldBoundTo(employee.employer().name()), and in cases where you don't need a meta model you'll be able bind directly to the auto-generated model. This is a little old now but give's a bit of an idea:https://wave.google.com/wave/waveref/googlewave.com/w+UQNykyjbA I'd also like to see this integrated with the new gwt validation code (or at least a similar mechanism), so if anyone feels like contributing drop me a line. Cheers Andrew On Sep 28, 12:59 am, P.G.Taboada pgtabo...@googlemail.com wrote: Learn from gwt-pectin, this is a comment I found in the bikeshed source code. And, I must say, gwt-pectin is a really nice binding and validation framework. To be honest, it is the best I have seen until now. My wishlist? GWT uses a metamodel and API like gwt-pectin does provide, plus a nice uibinder integration to make things easier. And, by the way, what about a fluent builder API for forms like the one in gwt-mosaic? Badly missing something like that in GWT. brgds, Papick On 27 Sep., 10:51, Thomas Broyer t.bro...@gmail.com wrote: On Sep 27, 2:47 am, nacho vela.igna...@gmail.com wrote: Hi, searching on google i've found a few gwt validation libraries. I would like to know if you are using anyone in special or if you have tested some of them. FYI, GWT 2.1 should come with built-in support for javax.validation. I don't know if they borrowed code from there but the GWT team has been talking a lot with the maintainer of the gwt-validation project:https://wave.google.com/wave/waveref/googlewave.com/w+yAUzf_-lA(you have to be subscribed to the GWT-Contributors Google Group to access the wave) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Any recommended input validation lib?
On Sep 27, 2:47 am, nacho vela.igna...@gmail.com wrote: Hi, searching on google i've found a few gwt validation libraries. I would like to know if you are using anyone in special or if you have tested some of them. FYI, GWT 2.1 should come with built-in support for javax.validation. I don't know if they borrowed code from there but the GWT team has been talking a lot with the maintainer of the gwt-validation project: https://wave.google.com/wave/waveref/googlewave.com/w+yAUzf_-lA (you have to be subscribed to the GWT-Contributors Google Group to access the wave) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Any recommended input validation lib?
Learn from gwt-pectin, this is a comment I found in the bikeshed source code. And, I must say, gwt-pectin is a really nice binding and validation framework. To be honest, it is the best I have seen until now. My wishlist? GWT uses a metamodel and API like gwt-pectin does provide, plus a nice uibinder integration to make things easier. And, by the way, what about a fluent builder API for forms like the one in gwt-mosaic? Badly missing something like that in GWT. brgds, Papick On 27 Sep., 10:51, Thomas Broyer t.bro...@gmail.com wrote: On Sep 27, 2:47 am, nacho vela.igna...@gmail.com wrote: Hi, searching on google i've found a few gwt validation libraries. I would like to know if you are using anyone in special or if you have tested some of them. FYI, GWT 2.1 should come with built-in support for javax.validation. I don't know if they borrowed code from there but the GWT team has been talking a lot with the maintainer of the gwt-validation project:https://wave.google.com/wave/waveref/googlewave.com/w+yAUzf_-lA(you have to be subscribed to the GWT-Contributors Google Group to access the wave) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Any recommended input validation lib?
Hi there, thanks for your compliments about pectin. Just as a matter of interest I've started talking with the author of Bindgen (http://bindgen.org/) about the possibilities of using it with pectin and things are looking promising. If we can get it working (and I think we can) you'll be able to create meta models using type safe code completed bindings generated from your bean graph. e.g. fieldBoundTo(employee.employer().name()), and in cases where you don't need a meta model you'll be able bind directly to the auto-generated model. This is a little old now but give's a bit of an idea: https://wave.google.com/wave/waveref/googlewave.com/w+UQNykyjbA I'd also like to see this integrated with the new gwt validation code (or at least a similar mechanism), so if anyone feels like contributing drop me a line. Cheers Andrew On Sep 28, 12:59 am, P.G.Taboada pgtabo...@googlemail.com wrote: Learn from gwt-pectin, this is a comment I found in the bikeshed source code. And, I must say, gwt-pectin is a really nice binding and validation framework. To be honest, it is the best I have seen until now. My wishlist? GWT uses a metamodel and API like gwt-pectin does provide, plus a nice uibinder integration to make things easier. And, by the way, what about a fluent builder API for forms like the one in gwt-mosaic? Badly missing something like that in GWT. brgds, Papick On 27 Sep., 10:51, Thomas Broyer t.bro...@gmail.com wrote: On Sep 27, 2:47 am, nacho vela.igna...@gmail.com wrote: Hi, searching on google i've found a few gwt validation libraries. I would like to know if you are using anyone in special or if you have tested some of them. FYI, GWT 2.1 should come with built-in support for javax.validation. I don't know if they borrowed code from there but the GWT team has been talking a lot with the maintainer of the gwt-validation project:https://wave.google.com/wave/waveref/googlewave.com/w+yAUzf_-lA(you have to be subscribed to the GWT-Contributors Google Group to access the wave) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Any recommended input validation lib?
Hi, searching on google i've found a few gwt validation libraries. I would like to know if you are using anyone in special or if you have tested some of them. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Input Validation
Dude , thanks a ton. its a gud idea to work on :) thanks again On Sep 23, 7:18 pm, monk3y darkside...@hotmail.com wrote: Expanding on what Geraldo already said you can have the following Button saveBtn = new Button(Save) saveBtn.addClickHandler( new ClickHandler() { public void onClick(Event event) { if(checkData()){ form.submit(); }else{ //no submit } } } }); public boolean checkData(){ if(nameEditBox.getText().trim().equals()){ Window.alert(Name can not be blank); return false; } if(phoneBox.getText().trim().equals()){ Window.alert(Phone can not be blank); return false; } return true; } You get the idea :). On Sep 23, 3:27 am, Geraldo Lopes geraldo...@gmail.com wrote: mohan, At client you can put an event on button that advises the user to enter proper information. Button saveBtn = new Button(Save) saveBtn.addClickHandler( new ClickHandler() { public void onClick(Event event) { if (nameEditBox.getText().equals()) { Window.alert(bla bla bla) return; } } }); if thevalidationdepends on the server you can use gwt rpc mechanism to achieve that http://code.google.com/intl/en/webtoolkit/doc/1.6/DevGuideServerCommu... Good Luck, Geraldo On 22 set, 06:49, mohan yen.mo...@gmail.com wrote: Hi, I am very new to GWT. I have a form with Name,phone and email. I need to validate theinput. How can i do that? Kindly guide me. Thanks in advance. Cheers!!! Mohan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Input Validation
Expanding on what Geraldo already said you can have the following Button saveBtn = new Button(Save) saveBtn.addClickHandler( new ClickHandler() { public void onClick(Event event) { if(checkData()){ form.submit(); }else{ //no submit } } } }); public boolean checkData(){ if(nameEditBox.getText().trim().equals()){ Window.alert(Name can not be blank); return false; } if(phoneBox.getText().trim().equals()){ Window.alert(Phone can not be blank); return false; } return true; } You get the idea :). On Sep 23, 3:27 am, Geraldo Lopes geraldo...@gmail.com wrote: mohan, At client you can put an event on button that advises the user to enter proper information. Button saveBtn = new Button(Save) saveBtn.addClickHandler( new ClickHandler() { public void onClick(Event event) { if (nameEditBox.getText().equals()) { Window.alert(bla bla bla) return; } } }); if the validation depends on the server you can use gwt rpc mechanism to achieve that http://code.google.com/intl/en/webtoolkit/doc/1.6/DevGuideServerCommu... Good Luck, Geraldo On 22 set, 06:49, mohan yen.mo...@gmail.com wrote: Hi, I am very new to GWT. I have a form with Name,phone and email. I need to validate the input. How can i do that? Kindly guide me. Thanks in advance. Cheers!!! Mohan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Input Validation
Hi, I am very new to GWT. I have a form with Name,phone and email. I need to validate the input. How can i do that? Kindly guide me. Thanks in advance. Cheers!!! Mohan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---