Jump to content

Form validation


surreal53

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

Archived

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

×
×
  • Create New...