Jump to content

Form validation


Recommended Posts

I've written a form validation script to check if a text field contains either M or F as a value. If it contains anything else but the values M or F it should create an alert (Not a valid entry). For some reason the alert pops up for any value that is typed into the field even M or F. Any idea what I'm doing wrong?

function ValidateS()  { var s1=Xrm.Page.getAttribute("new_s").getValue() -0; if (s1!="F" || s1!="F")  {  alert("That is not a valid entry");  return false;  }}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...