1

i have to allow user to enter only RH factor of blood like -ve,+ve how to do this in java script. also can i use the same thing in java also?

Please help.

Regards

Java Questions
  • 7,813
  • 41
  • 118
  • 176
  • 2
    Java and JavaScript are completely different languages, so no, you will probably not be able to do the same thing. Also: show us what you've tried and give some context. It's quite hard to fathom what is being asked here. – Elias Van Ootegem Nov 05 '12 at 06:48

1 Answers1

1

Use regular expression. Its available in java and javascript both.

Check RegEx for Javascript to allow only alphanumeric for better understanding of regex expression.

for +ve and -ve 
var regex = /^[-+]+[v]+[e]$/i;

this is working..i just checked..enjoy

Community
  • 1
  • 1
arrest warrant
  • 344
  • 2
  • 17