469,306 Members | 1,903 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Java script searching functions

4
Hi all,

I'm in need of help again :confused:

I have a reference to a url stored within a text field on a form on a webpage.

Pls see url below:
Expand|Select|Wrap|Line Numbers
  1.  ********************************************************** 
  2. A<1,?,'Func'='formwf.saveform','LL_Editable'=true,'LL_FormID'='1','LL_FormViewID'=19130344,'LL_ID'=31610513,'LL_NextURL'='/primecontract/collab
  3. func=formwf.FormEdit&WorkID=31610513&SubWorkID=31610513&formID=1&viewname=Status%2Ehtml&editable=true&NextURL=%
  4. 2Fprimecontract%2Fcollab%3Ffunc%3Dwork%2Eframestatustasks%26workid%3D31610513%26subworkid%3D31610513%26paneindex%3D7%26status%
  5. 3DNoArchive%26sort%3DAn+unknown+feature+was+specified%26kind%3DAll%26stepsort%3DType%26title%3DWorkflow%2BStatus%26nextURL%3D%252Fprimecontract%252Fcollab%253Ffunc%253Dwork%252Estatus','LL_SubWorkID'=31610513,'LL_TaskID'=-1,'LL_TemplateID'=18825495,'LL_TemplateVersion'=63,'LL_WorkID'=31610513>
  6. **********************************************************
  7.  
I need to be able to search the field and extract the number that comes after WOrk ID.
The url above is only for one form ... the url changes for every form .... therefore, the character position of the work id number does not always appear in the same location :(

Can anybody please tell me how i can search the field containing the url above and extract the number (31610513) that comes after the works: Work ID, to a different filed so i can reuse it to create another url !!!!!!


I'm burnt out trying !! :eek:



Many Thanks


R :cool:
Mar 1 '06 #1
1 1901
Banfa
9,064 Expert Mod 8TB
I would suggest that you use the string method indexOf like so

document.formName.textFieldName.value.indexOf("LL_ WordID");

this will give you the index to the start of the search string and you can easily work out the index of the number from that.

For more help about this and other string functions see here, part of the www.w3schools.com website which I use as a general reference for all things webby.
Mar 1 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Andy R. | last post: by
73 posts views Thread by RobertMaas | last post: by
6 posts views Thread by harish | last post: by
9 posts views Thread by Tuy Solang | last post: by
2 posts views Thread by Marek Staniewski | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.