Appcelerator - email validation on TextField - textfield

What's the best method to check textfield input for email, using Appcelerator Studio?
Can I use regex or what?
Thanks,
Zoltan

you can use normal javascript to check for an email. See https://stackoverflow.com/a/46181/5193915
and pass $.textfield.value into the function.

Related

Titanium: On The Fly Masked TextField

Titanium-Alloy SDK 3.2.1, Android 4.2.2.
Hi there, I would like to know if you have had the need to mask a textfield on the fly.
One project I am working on needs the user to input some formatted numbers (numbers+punctuation). On my best efforts, I've made a example project that makes use of a masked textfield using keypressed events on Android. It's HERE.
Questions are:
Should I follow this route?
Or is there a good module avaiable for this?
Any generic javascript option available (no DOM)?
Any suggestions or better ideas of how to deal with the
problem?
Thanks.
passwordMask is a boolean textfield property. If you need to dynamically toggle it, just do so in the controller like
if (condition){
textFieldName.passwordMask = true;
}

Is it possible to capture the text on the recaptcha image and type the same in a text box using selenium rc

It is required for me to capture the text present on the recaptcha image and type the same in a text box. Can any one please share me the solution how can we do this using selenium rc or webdriver and share me the code also using java.
You can not automate captcha, but there is some way to deal with captcha but for that human interaction is required.
There are two ways in which you can automate CAPTCHA
1.By break command
2.By input-box
For input box
String captcha = selenium.getEval("prompt("Enter Captcha")");
selenium.type("fieldId", captcha);
If it were possible, what would be the point of CAPTCHA images? If you bypass it in Selenium, what's stopping an attacker doing that? This is not possible, for very good reasons.
Instead just disable CAPTCHA for your test environment.
If it's possible to "cheat" in your test environment I would have the expected value added to a hidden field and pull from there.
There is additional solution i described here and it's to use CAPTCHA solver services API.
For example:
http://www.deathbycaptcha.com. You implementing their API, passing them the CAPTCHA and get in return the text.
Example for implementation here.

How to disable JavaScript in Cocoa WebView?

I'd like to use Cocoa WebView for display of email messages. For security/privacy purposes I want to disable JavaScript but, incredibly enough, can't find any way to do it in the documentation.
Thanks in advance for any hints.
Check out WebView's -(WebPreferences *)preferences, which has a -(void)setJavascriptEnabled:(BOOL)flag option.

Sencha Touch Passcode

Is there a control in Sencha Touch to show a passcode field like shown in picture below?
No theres no native component who does exactly this. But you can build it by yourself: its a form with 4 input fields and a dozen buttons. See documentation for more details: http://docs.sencha.com/touch/1-1/#!/api/Ext.form.FormPanel
No, you have to build and design this one completly by yourself.
Note: To get rid of the browser controls, you have to enforce that the application is running form the homescreen. You can control (with some Javascript) if the application is running MobileSafari or as a "Web App". (see: http://cubiq.org/add-to-home-screen as an example of such an implementation)
But, however, I would not recommend using such a component. A) This can confuse people and B) Can intent users to type in their regular passcode. As a developer I wouldn't be comfortable with that situation.

How do you create a hyperlink in iOS?

How do you create a hyperlink in an iOS app?
It also answered here in a similar SO question:
How to parse and show hyperlinks (phone number/email addresses etc) in UILabel?
Where? Take a look at UITextView's dataDetectorTypes property. Specifically UIDataDetectorTypeLink or UIDataDetectorTypeAll.