Fórum
Liferay js not working
dave ch, modificado 11 Anos atrás.
Liferay js not working
Regular Member Postagens: 161 Data de Entrada: 07/02/12 Postagens Recentes
Hi all,
I am trying to compare two var's in liferay js. But it's not working :
var currentEntries = instance.get('curEntries');
alert("currentEntries :" +currentEntries); // getting all entries like sam, john, kate
for(var i=0; i<currentEntries.length; i++){
var entries = currentEntries;
alert("entries :"+entries.type); // working under For loop
var text = instance.inputNode.val();
alert("text :" +text); // getting, the text i have recently entered
if(text.equals(entries))
{
alert("This Already Exist"); // This is not getting compared
}
The alert This Already Exist that suppose to come is not comming.
If this is not the right way, then, is there any other approach in liferay js. ?
Regards,
I am trying to compare two var's in liferay js. But it's not working :
var currentEntries = instance.get('curEntries');
alert("currentEntries :" +currentEntries); // getting all entries like sam, john, kate
for(var i=0; i<currentEntries.length; i++){
var entries = currentEntries;
alert("entries :"+entries.type); // working under For loop
var text = instance.inputNode.val();
alert("text :" +text); // getting, the text i have recently entered
if(text.equals(entries))
{
alert("This Already Exist"); // This is not getting compared
}
The alert This Already Exist that suppose to come is not comming.
If this is not the right way, then, is there any other approach in liferay js. ?
Regards,
dave ch, modificado 11 Anos atrás.
RE: Liferay js not working
Regular Member Postagens: 161 Data de Entrada: 07/02/12 Postagens Recentes
Even the type it is showing as String. Then why these two strings are not getting compared.
alert(typeof entries ); //String
alert(typeof text); //String
Even i tried to compare them using Ascii
if(toAscii(text)==toAscii(entries))
but still they are different and not the same when compared.
Can any body hav any idea on this?
Regards
alert(typeof entries ); //String
alert(typeof text); //String
Even i tried to compare them using Ascii
if(toAscii(text)==toAscii(entries))
but still they are different and not the same when compared.
Can any body hav any idea on this?
Regards
dave ch, modificado 11 Anos atrás.
RE: Liferay js not working
Regular Member Postagens: 161 Data de Entrada: 07/02/12 Postagens Recentes
Any One?