You need to sign in to do that
Don't have an account?
How to compare inputField value with string on VF page?
Can any one plz tell me
how we can compare input field value with String on VF page.
You need to sign in to do that
Don't have an account?
Something like this might work for you.This code is not tested.
function compareString(){
var strElement = document.getElementById('{!$Component.validateString.name}').value;
if(strelemt == 'check')
return true
alert('error');
return false;
}
<apex:form id='validateString'>
<apex:commandButton id="save" onclick="javascript:compareString()"/>
<apex:inputfield id='validateString' >
</apex:form>