example (that does nothing and doesn't work):

$form['personal']['phone'] = array(
'#type' => 'phone',
'#title' => t('Phone'),
'#required' => TRUE,
'#default_value' => "",
'#description' => "Please enter your phone.",
);

surely there is a trick to this that I'm missing?

Comments

themselves’s picture

No one? It's not possible to use these fields from the Form API?

Anonymous’s picture

Seconded.

hobo’s picture

third.. can i add this field to a from using fapi?

Anonymous’s picture

Obviously the best way to do it would be create a fieldgroup using the Form API and nesting 3 fields in it. It's just the validation and submission functions won't be very fun to come up with...

MustangGB’s picture

Version: 6.x-2.9 » 7.x-2.x-dev

Any ideas on this one yet?

-enzo-’s picture

Seconded

cweagans’s picture

Status: Active » Postponed

In 7.x, you can't do this just yet. 7.x-2.x is NOT production ready, and it probably won't be for a while. I've been slowly working on it, but I don't have a lot of time these days.

In 6.x, you should be able to use the phone_textfield element (see http://drupalcode.org/project/phone.git/blob/refs/heads/6.x-1.x:/phone.m...)

Postponing this to make sure support for FAPI is in 7.x-2.x

bradjones1’s picture

Category: support » feature
zkent’s picture

Issue summary: View changes

How about now?

gangaloo’s picture

I agree with @zkent. Is this now possible with the current dev version?

Thanks in advance.