Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

Getting Syntax error on runtime for the below script.

"SCRIPT1002: Syntax error"


JavaScript
function changetext(s, e){
var cmbThemes=document.getElementById('cmbThemes');
var selectedValue = cmbThemes.options[cmbThemes.selectedIndex].value;
var selectedText = cmbThemes.options[cmbThemes.selectedIndex].text;
alert(selectedValue);
alert(selectedText);
if (selectedText() == "Glass"){
alert ("Glass");
}
}


Any help is much appreciated. !!!!
Posted
Comments
JoCodes 26-Nov-13 7:07am    
Which line?
Thomas ktg 26-Nov-13 7:08am    
look at this place if (selectedText() == "Glass")
you have give like a method selectedText(),remove the brackets () and see if it is working fine.

Hi Rahul,
In IF condition you have added open and close parenthesis for selectedText like this selectedText().

Remove () from the selectedText in IF condition will do the trick I believe,so giva a try....

Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
v2
Comments
Rahul Krishnan R 26-Nov-13 7:31am    
Guys, tried removing open and close parenthesis and that didn't turn up working.
Thanks any ways.
♥…ЯҠ…♥ 26-Nov-13 7:44am    
Again throwing error?
Rahul Krishnan R 26-Nov-13 22:36pm    
Yes
♥…ЯҠ…♥ 26-Nov-13 22:55pm    
We can't visualize your screen, so you should make us to understand clearly be giving error description,error in which line those are important here.
raneshtiwari 27-Nov-13 7:43am    
Do you getting correct value in alert?
Hi Guys,

I managed to solve the issue. The issue was really on the clientsideeditor of Devexpress i guess.
It was not allowing more than 1 function in an event.

Thanks for your support anyways.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900