Can someone tell me/show me what I'm doing wrong here please?

I'm duplicating a fieldset that contains an input form. However, within this fieldset lies the string:
<a href="#" onclick="showImageList(x);.....

... where (x) is the zero-based number of the fieldsets in the overall form.

So, for example, if x = 2, then what I'm trying (and failing) to do is replace the string "showImageList(2" with "showImageList(3"


        var clonedRow = $( "#sshow_input fieldset:last" ).clone();
        var iRowID =  parseFloat(clonedRow.attr("id").substr(-1,1));
        var iCurrentOrder =  $( "#iOrder"+ iRowID , clonedRow).attr("value");
        iCurrentOrder = parseFloat(iCurrentOrder);
        //$.log(iCurrentOrder);
        iNewID = iRowID + 1;
        //$.log('iNewID=' + ' ' + iNewID );
        s=clonedRow;
        var myString = 'showImageList'+iRowID;
        var myString2 = 'showImageList'+iNewID;
        var myString3 = s.replace(myString,myString2);

The error message I get is s.replace is not a function.

Can someone spot my mistake, or suggest an alternative approach

Thanks

Bruce 

Reply via email to