Question : Regular expression and dash in JavaScript

Hello experts:

I have this piece of code that checks for numeric charaters in a field using JavaScript on form submit.

How can I add the character "-" (dash) to this code?  I need this for the phone number field where folks can enter numbers and dashes.

Thank you,

--d.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

Answer : Regular expression and dash in JavaScript

Not sure if you have Facebook Connect on your site.  If not, take a look at this tutorial page on to implement Share button/link.  Then you can just stick a <img> tag between the <a></a> with your custom button image.  For example:
<a name="fb_share" type="icon" share_url="YOUR_URL"><img src="/img/custombutton.png"></a>.  That way your custom button gets displayed with clickable FB link.

If you have Facebook Connect implemented, I'm sure there's a way to customize it too, but I haven't looked into it.

Random Solutions  
 
programming4us programming4us