Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript PHP
Hi all
i want to get the value of this id...

var val='categoryName_'+value2;
 
  var value1=document.getElementById('categoryName_'+value2).value;
Posted 29-Dec-12 2:10am
Edited 29-Dec-12 2:13am
v2
Comments
jibesh at 29-Dec-12 7:29am
   
what error you are getting ?
GeekBond at 29-Dec-12 9:04am
   
What is stopping you from getting it?
Sandeep Mewara at 29-Dec-12 12:52pm
   
And the issue is?
SureshDasari1986 at 30-Dec-12 9:12am
   
what is the control element for this id 'categoryName_'+value2,
check the id of the control in browser view source.
AshishChaudha at 31-Dec-12 6:07am
   
what control you are using???
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

it gives result
var val='categoryName_'+value2;
 
  var value1=document.getElementById('categoryName_'+value2).value;
please give what is your error or problem.....
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

better you use pass temp variable To get the value.
 

var val='categoryName_' + value2;

var value1=document.getElementById(val);
 
//if it is just ID this works
alert(value1.innerHtml);
 
But, cant get the value of the server side controls because it wont allow the usage of (.clientID) , during string concatenation.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It should work ... What error or issue you are facing ? Elaborate your situation please
  Permalink  

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

  Print Answers RSS
0 DamithSL 285
1 Zoltán Zörgő 170
2 OriginalGriff 140
3 Sergey Alexandrovich Kryukov 120
4 Maciej Los 115
0 OriginalGriff 7,740
1 DamithSL 5,769
2 Sergey Alexandrovich Kryukov 5,424
3 Maciej Los 5,076
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100