473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

javascript string manipulation

hey all,
what's the best way to extract info from the following string:

controlvalueid_ctl02_DrpX

i need "_Drp" and everything to the right of it.

thanks,
rodchar
Apr 9 '08 #1
6 956
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:FB**********************************@microsof t.com...
what's the best way to extract info from the following string:

controlvalueid_ctl02_DrpX

i need "_Drp" and everything to the right of it.
Are you trying to find the server-side control ID, as opposed to the
"munged" client-side control ID...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Apr 9 '08 #2

var s = 'controlvalueid_ctl02_DrpX'.match(/_Drp.*$/)

-- bruce (sqlwork.com)
"rodchar" wrote:
hey all,
what's the best way to extract info from the following string:

controlvalueid_ctl02_DrpX

i need "_Drp" and everything to the right of it.

thanks,
rodchar
Apr 9 '08 #3
yes Mark but this is the only way i know to get it thru javascript. is there
another way?

"Mark Rae [MVP]" wrote:
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:FB**********************************@microsof t.com...
what's the best way to extract info from the following string:

controlvalueid_ctl02_DrpX

i need "_Drp" and everything to the right of it.

Are you trying to find the server-side control ID, as opposed to the
"munged" client-side control ID...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Apr 9 '08 #4
use
DrpX.ClientID
or sometimes
DrpX.UniqueID

depending on what you need name or id of the control...
George.
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:B0**********************************@microsof t.com...
yes Mark but this is the only way i know to get it thru javascript. is
there
another way?

"Mark Rae [MVP]" wrote:
>"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:FB**********************************@microso ft.com...
what's the best way to extract info from the following string:

controlvalueid_ctl02_DrpX

i need "_Drp" and everything to the right of it.

Are you trying to find the server-side control ID, as opposed to the
"munged" client-side control ID...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


Apr 9 '08 #5
but that's on the server-side right? because i'm trying to get to the element
in javascript.

"George Ter-Saakov" wrote:
use
DrpX.ClientID
or sometimes
DrpX.UniqueID

depending on what you need name or id of the control...
George.
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:B0**********************************@microsof t.com...
yes Mark but this is the only way i know to get it thru javascript. is
there
another way?

"Mark Rae [MVP]" wrote:
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:FB**********************************@microsof t.com...

what's the best way to extract info from the following string:

controlvalueid_ctl02_DrpX

i need "_Drp" and everything to the right of it.

Are you trying to find the server-side control ID, as opposed to the
"munged" client-side control ID...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net



Apr 9 '08 #6
thanks for this one,
rod.

"bruce barker" wrote:
>
var s = 'controlvalueid_ctl02_DrpX'.match(/_Drp.*$/)

-- bruce (sqlwork.com)
"rodchar" wrote:
hey all,
what's the best way to extract info from the following string:

controlvalueid_ctl02_DrpX

i need "_Drp" and everything to the right of it.

thanks,
rodchar
Apr 10 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Davide R. | last post by:
Ciao a tutti, vi spiego il mio problema Ho una pagina HTML che referenzia un CSS esterno. Ho alcuni elementi HTML che appartengolo ad una classe (chiamiamola "class1"). Avrei la necessità,...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
3
by: Pavils Jurjans | last post by:
Hello, I am looking for some API that abstracts away all the differences in XML DOM parsers that are presnt in all supporting browsers - MSIE, Mozilla, Opera, Safari. Perhaps that is implemented...
4
by: WaterWalk | last post by:
Hello, I'm currently learning string manipulation. I'm curious about what is the favored way for string manipulation in C, expecially when strings contain non-ASCII characters. For example, if...
5
by: Alex Maghen | last post by:
I frequently find myself wanting to insert some basic client-side JavaScript functions in the page of an ASPX of mine. But I find it so frustrating that I have to actually contruct my JavaScript in...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
12
by: lorlarz | last post by:
Unobtrusive JavaScript leads to BUILDERS (e.g. drag drop activity builder) Once you totally remove JS from a web page, and learn the shortcuts and efficiencies provided by a library like...
76
by: lorlarz | last post by:
Crockford's JavaScript, The Good Parts (a book review). This shall perhaps be the world's shortest book review (for one of the world's shortests books). I like Douglas Crockford (because I am a...
2
by: ManidipSengupta | last post by:
Hi, a few (3) questions for the Java experts, and let me know if this is the right forum. It deals with 100% java code (reason for posting here) but manages a Web browser with Javascript. Thanks in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.