You need to sign in to do that
Don't have an account?
Naresh Kumar 7
Can any one plz tell me
how we can compare input field value with String on VF page.
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.
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>