Javascrip Replace not Replacing

Discussion in 'Javascript' started by Brad, Jul 5, 2006.

  1. Brad

    Brad Guest

    I have the following function:

    function updaterec(i, callid){
    var theExp = new RegExp(callid, 'gi');
    var x = document.getElementById(i.id.replace(RegExp,'tb_linechage'));
    x.value = 'Y';}

    I call this function with:
    updaterec(this, 'tb_assigneddt'); // this =
    dl_inspectionlist__ctl1_tb_assigneddt

    I want to update dl_inspectionlist__ctl1_tb_linechage but
    dl_inspectionlist__ctl1_tb_assigneddt keeps updating itself instead.
    What am I missing?

    Any help is greatly appreciated.

    Thanks,
    Brad
    Brad, Jul 5, 2006
    #1
    1. Advertising

  2. "Brad" <> writes:

    > var theExp = new RegExp(callid, 'gi');

    ^^^^^^
    > var x = document.getElementById(i.id.replace(RegExp,'tb_linechage'));

    ^^^^^^
    The "RegExp" should probably be "theExp".

    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
    Lasse Reichstein Nielsen, Jul 5, 2006
    #2
    1. Advertising

  3. Brad

    Brad Guest

    Um, Yeah, that would be it...

    You know, this is one of those days you wish you could go back to bed
    and start all over.

    Thanks for pointing out the obvious.

    ~Brad
    Brad, Jul 5, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Ladd

    Disable Calendar Control from javascrip

    Robert Ladd, Feb 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,251
    Robert Ladd
    Feb 27, 2005
  2. =?utf-8?B?4pmlZVh0cmVtZSBvWHlnZW7imaU=?=

    How do i call JAVASCRIP function if...

    =?utf-8?B?4pmlZVh0cmVtZSBvWHlnZW7imaU=?=, Aug 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    464
    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmE=?=
    Aug 25, 2006
  3. Ganesh
    Replies:
    1
    Views:
    430
    clintonG
    Aug 2, 2007
  4. deepak kumar
    Replies:
    0
    Views:
    136
    deepak kumar
    Oct 30, 2004
  5. Rob Meade

    Replacing - and not Replacing...

    Rob Meade, Apr 5, 2005, in forum: ASP General
    Replies:
    5
    Views:
    254
    Chris Hohmann
    Apr 11, 2005
Loading...

Share This Page