HighDots Forums  

Need a new data mask

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Need a new data mask in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
_adrian
 
Posts: n/a

Default Need a new data mask - 12-24-2007 , 12:26 PM






So DW8 already has the behaviors built in to take data from a recordset, and
format it (like date, or numbers) .. but I need it to be able to take the 10
digits from the particular field, and format it as a phone number: (xxx)
xxx-xxxx .... I don't have the programming skills myself to do this, but if
anyone knows of a tutorial or extension to help, I'd appreciate hearing
about it.

Happy hoolidays folks..



Reply With Quote
  #2  
Old   
Joe Makowiec
 
Posts: n/a

Default Re: Need a new data mask - 01-04-2008 , 03:47 AM






On 24 Dec 2007 in macromedia.dreamweaver, _adrian wrote:

Quote:
So DW8 already has the behaviors built in to take data from a
recordset, and format it (like date, or numbers) .. but I need it to
be able to take the 10 digits from the particular field, and format
it as a phone number: (xxx) xxx-xxxx .... I don't have the
programming skills myself to do this, but if anyone knows of a
tutorial or extension to help, I'd appreciate hearing about it.
Sorry - missed this in all the holiday hoopla. If you still need it:

<?php if (strlen($row_members['telephone'])>0) { ?>
(<?php echo substr($row_members['telephone'],0,3); ?>) <?php echo substr($row_members['telephone'],3,3); ?>-<?php echo substr($row_members['telephone'],6,4); ?>
<?php }?>

Assumes that the telephone number in the 'telephone' field is a standard
10-digit North American number and uses PHP's substr function to extract
area code, exchange and number. 'telephone' should be of type varchar.
This assumes PHP/MySQL; other models should be similar.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php


Reply With Quote
  #3  
Old   
_adrian
 
Posts: n/a

Default Re: Need a new data mask - 01-11-2008 , 01:49 PM



Hey Joe.. my bad. I should have specified the data is ASP/SQL Server ..
thoughts? Suggestions?



Reply With Quote
  #4  
Old   
_adrian
 
Posts: n/a

Default Re: Need a new data mask - 01-11-2008 , 01:49 PM



Hey Joe.. my bad. I should have specified the data is ASP/SQL Server ..
thoughts? Suggestions?



Reply With Quote
  #5  
Old   
Joe Makowiec
 
Posts: n/a

Default Re: Need a new data mask - 01-11-2008 , 02:30 PM



On 11 Jan 2008 in macromedia.dreamweaver, _adrian wrote:

Quote:
Hey Joe.. my bad. I should have specified the data is ASP/SQL Server
.. thoughts? Suggestions?
I don't have time to look it up at the mo', but VBScript should have a
substring function, no? It would work the same, just substitute
VBScript's function. Ah, here - mid():

http://devguru.com/technologies/vbscript/13951.asp

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php


Reply With Quote
  #6  
Old   
Joe Makowiec
 
Posts: n/a

Default Re: Need a new data mask - 01-11-2008 , 02:30 PM



On 11 Jan 2008 in macromedia.dreamweaver, _adrian wrote:

Quote:
Hey Joe.. my bad. I should have specified the data is ASP/SQL Server
.. thoughts? Suggestions?
I don't have time to look it up at the mo', but VBScript should have a
substring function, no? It would work the same, just substitute
VBScript's function. Ah, here - mid():

http://devguru.com/technologies/vbscript/13951.asp

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php


Reply With Quote
  #7  
Old   
_adrian
 
Posts: n/a

Default Re: Need a new data mask - 01-11-2008 , 04:05 PM



I'll check it out.. thx for the point



Reply With Quote
  #8  
Old   
_adrian
 
Posts: n/a

Default Re: Need a new data mask - 01-11-2008 , 04:05 PM



I'll check it out.. thx for the point



Reply With Quote
  #9  
Old   
_adrian
 
Posts: n/a

Default Re: Need a new data mask - 01-14-2008 , 05:47 PM



Hmm.. that looks like it just cuts off by x numbers of characters.. I
actually need to place the parentheses around the phone prefix, and add the
dash between the two other sets of numbers.. all form a single string from
the DB that otherwise looks like this:

2065551212



Reply With Quote
  #10  
Old   
_adrian
 
Posts: n/a

Default Re: Need a new data mask - 01-14-2008 , 05:47 PM



Hmm.. that looks like it just cuts off by x numbers of characters.. I
actually need to place the parentheses around the phone prefix, and add the
dash between the two other sets of numbers.. all form a single string from
the DB that otherwise looks like this:

2065551212



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.