Sorry, should have been more explicit
This is in a codebehind file and is using IsStartupScriptRegistered to run
the javascript
all of what follows is in the script code
I am passing to a function a name attribute from an img tag. I have checked
the name attribute and it is what I want but
when I try to use it in the following script code I can not get the passed
attribute to convert to its actual value.
I have tried using
The attribute passed is called card
sString.Append("document.forms[0]." + card + ".style.visibility =
'hidden'")
You would think the above would work but the attribute card needs to be put
in "card" for the syntax to work and of course this does not convert
properly
Any help is appreciated.
"Mark Micallef" <ma***********@unspell.you.see.a.mess.net> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi Barry,
Where are you getting the Append() method from? Is this server or client
side code? Neither the .Net String class (v1.1) or the JavaScript string
class (v2.0) have an append method as far as I can tell.
If this is client-side javascript as I suspect, I would suggest the
following. The replace() method uses regular expressions (yuck!):
function namedSubstitude( ElementName )
{
// assumes sString is in scope for somewhere...
sString.replace(/NAMED/i, ElementName) ;
}
Hope this helps,
Mark
barry wrote:
I have the following:
function(NAMED)
{
sString.Append("document.forms[0].NAMED.style.visibility = 'hidden'")
}
and would like to convert the NAMED into the object it represents - for
example in this case it represents the name of an image called card17
thanks