Welcome visitor
* Login
* Register
It is currently March 26th, 2019, 6:34 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » JavaScript



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  code not working
PostPosted: June 10th, 2009, 8:43 am 

Posts: 19
hi, i got this from another site but is not doing what it is supposed to
function admin(){
var ind = document.getElementById('box1');

if(txt='1'){case1()}
else if(txt='2'){case2()}
else if(txt='3'){case3()}
}

it compares the value of the input and according to the value (1, 2 or 3) it calls another function. can someone tell me what is wrong with this? thanks.


Top
 Profile  
 
  Re: code not working
PostPosted: June 10th, 2009, 8:47 am 
User avatar

Posts: 112
function admin(){
var ind = document.getElementById('box1').value;

if(txt=='1'){case1()}
else if(txt=='2'){case2()}
else if(txt=='3'){case3()}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » JavaScript


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron