Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
dave ch
Liferay js not working
15 febbraio 2013 9.00
Risposta

dave ch

Punteggio: Regular Member

Messaggi: 164

Data di Iscrizione: 6 febbraio 2012

Messaggi recenti

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,
dave ch
RE: Liferay js not working
15 febbraio 2013 12.07
Risposta

dave ch

Punteggio: Regular Member

Messaggi: 164

Data di Iscrizione: 6 febbraio 2012

Messaggi recenti

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
dave ch
RE: Liferay js not working
16 febbraio 2013 6.55
Risposta

dave ch

Punteggio: Regular Member

Messaggi: 164

Data di Iscrizione: 6 febbraio 2012

Messaggi recenti

Any One?