Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

java and tep_draw_input_field


zeberrun

Recommended Posts

how can i write java format type in tep_draw_input_field value.

 

customer write 2222536667

formats (222)253-6667

 

 

 

<script>

//(XXX)XXX-XXXX

function formatPhone(obj)

{

var p=/^([\d]{3})([\d]{3})([\d]{4,})$/.exec(obj.value);

obj.value="("+p[1]+")"+p[2]+"-"+p[3]

}

</script>

<input onblur="formatPhone(this)">

 

how can i use formatPhone(this) below?

 

<td class="fieldKey"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>

<td class="fieldValue"><?php echo tep_draw_input_field('telephone', '', 'size="10", maxlength="64"', 'class="input"') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...