473,394 Members | 1,829 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,394 software developers and data experts.

expected identifier error

sString.Append("document.forms[0]. + name + .style.visibility = 'hidden'" &
vbCrLf)

The above is found in a function which has had name passed to it. This
code is in the asp.net codebehind

The name converts to card17 and would like code to look like this when
converted:

document.forms[0].card17.style.visibility = hidden

Would appreciate any help
thanks

Dec 24 '05 #1
6 2112
"barry" <fl******@ix.netcom.com> wrote in
news:us**************@TK2MSFTNGP15.phx.gbl:
sString.Append("document.forms[0]. + name + .style.visibility =
'hidden'" & vbCrLf)

The above is found in a function which has had name passed
to it. This code is in the asp.net codebehind

The name converts to card17 and would like code to look like
this when converted:

document.forms[0].card17.style.visibility = hidden

Would appreciate any help
thanks


Barry,

sString.Append("document.forms[0].");
sString.Append(name);
sString.Append(".style.visibility = 'hidden';");
sString.Append(vbCrLf);

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Dec 24 '05 #2
The problem Chris is that the sString.Append(name) gives an error about not
being declared

"Chris R. Timmons" <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
"barry" <fl******@ix.netcom.com> wrote in
news:us**************@TK2MSFTNGP15.phx.gbl:
sString.Append("document.forms[0]. + name + .style.visibility =
'hidden'" & vbCrLf)

The above is found in a function which has had name passed
to it. This code is in the asp.net codebehind

The name converts to card17 and would like code to look like
this when converted:

document.forms[0].card17.style.visibility = hidden

Would appreciate any help
thanks


Barry,

sString.Append("document.forms[0].");
sString.Append(name);
sString.Append(".style.visibility = 'hidden';");
sString.Append(vbCrLf);

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

Dec 24 '05 #3
"barry" <fl******@ix.netcom.com> wrote in
news:ej**************@TK2MSFTNGP09.phx.gbl:
The problem Chris is that the sString.Append(name) gives an
error about not being declared


Barry,

What type is sString? Could you post more code that demonstrates the
problem?

Thanks.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Dec 24 '05 #4
Chris here is the code. Basically it presents cards to the page and when I
click on a card I want it to become invisible. (line xx)
I have not given you all the code that goes through numbering the cards etc.
I have done a alert on the name parm and it does show the correct card being
clicked on ----- but how to convert it so line xx accepts it is the
problem.
************************************************** *********
Dim sString As System.Text.StringBuilder
sString = New System.Text.StringBuilder

sString.Append("<script language='Javascript'>" & vbCrLf)

sString.Append("document.write(""<img class=setup")
sString.Append(r)
sString.Append(" src=../Solitary/images/")
sString.Append(abc)
sString.Append(" name=card")
sString.Append(r + u)
sString.Append(" id=card")
sString.Append(r + u)
sString.Append(" onclick=MakeInvisible(name)")
sString.Append(" runat = server")
sString.Append(">"");" & vbCrLf)

sString.Append("function MakeInvisible(name) {" & vbCrLf)

line xx sString.Append("(document.forms[0].name.style.visibility =
'hidden')" & vbCrLf)
}
sString.Append("</script>")
************************************************** *********

"Chris R. Timmons" <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
"barry" <fl******@ix.netcom.com> wrote in
news:ej**************@TK2MSFTNGP09.phx.gbl:
The problem Chris is that the sString.Append(name) gives an
error about not being declared


Barry,

What type is sString? Could you post more code that demonstrates the
problem?

Thanks.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

Dec 24 '05 #5
"barry" <fl******@ix.netcom.com> wrote in
news:ep**************@TK2MSFTNGP15.phx.gbl:
Chris here is the code. Basically it presents cards to the page
and when I click on a card I want it to become invisible. (line
xx) I have not given you all the code that goes through
numbering the cards etc. I have done a alert on the name parm
and it does show the correct card being clicked on ----- but
how to convert it so line xx accepts it is the problem.
************************************************** *********
Dim sString As System.Text.StringBuilder
sString = New System.Text.StringBuilder

sString.Append("<script language='Javascript'>" & vbCrLf)

sString.Append("document.write(""<img class=setup")
sString.Append(r)
sString.Append(" src=../Solitary/images/")
sString.Append(abc)
sString.Append(" name=card")
sString.Append(r + u)
sString.Append(" id=card")
sString.Append(r + u)
sString.Append(" onclick=MakeInvisible(name)")
sString.Append(" runat = server")
sString.Append(">"");" & vbCrLf)

sString.Append("function MakeInvisible(name) {" & vbCrLf)

line xx
sString.Append("(document.forms[0].name.style.visibility =
'hidden')" & vbCrLf) }
sString.Append("</script>")
************************************************** *********


Barry,

So it's the browser's JavaScript that's raising the error,
right? In that case, change line xx to call getElementById:

sString.Append("document.getElementById(name).styl e.visibility = 'hidden'; }" & vbCrLf)

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Dec 25 '05 #6
Thank you so very much - that sure did the trick - I really appreciate your
time.

"Chris R. Timmons" <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
"barry" <fl******@ix.netcom.com> wrote in
news:ep**************@TK2MSFTNGP15.phx.gbl:
Chris here is the code. Basically it presents cards to the page
and when I click on a card I want it to become invisible. (line
xx) I have not given you all the code that goes through
numbering the cards etc. I have done a alert on the name parm
and it does show the correct card being clicked on ----- but
how to convert it so line xx accepts it is the problem.
************************************************** *********
Dim sString As System.Text.StringBuilder
sString = New System.Text.StringBuilder

sString.Append("<script language='Javascript'>" & vbCrLf)

sString.Append("document.write(""<img class=setup")
sString.Append(r)
sString.Append(" src=../Solitary/images/")
sString.Append(abc)
sString.Append(" name=card")
sString.Append(r + u)
sString.Append(" id=card")
sString.Append(r + u)
sString.Append(" onclick=MakeInvisible(name)")
sString.Append(" runat = server")
sString.Append(">"");" & vbCrLf)

sString.Append("function MakeInvisible(name) {" & vbCrLf)

line xx
sString.Append("(document.forms[0].name.style.visibility =
'hidden')" & vbCrLf) }
sString.Append("</script>")
************************************************** *********
Barry,

So it's the browser's JavaScript that's raising the error,
right? In that case, change line xx to call getElementById:

sString.Append("document.getElementById(name).styl e.visibility =

'hidden'; }" & vbCrLf)
--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

Dec 25 '05 #7

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

Similar topics

5
by: andy.herrera | last post by:
I'm getting this Error Message. Expected ';' Please Select One: <form name="form1"> <<------------ Error is here. <select name="selectTrans" onChange="If (this.value == 'checkout')...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
7
by: Tony Tone | last post by:
I am having trouble resolving this issue: Server Error in '/test' Application. -------------------------------------------------------------------------------- Compilation Error Description:...
9
by: Jack | last post by:
I get the following errors from the code ( CRM 3.0 ) below, whats wrong ? Any suggestions are welcome because i'm kinda stuck here. The first error is pointing on the last bracket ] <--- ...
21
by: Ram Prasad | last post by:
I am trying to write a simple libspf2 plugin code for my postfix ( milter) I am getting this unhelpful error message when I try to compile gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c...
4
by: CodeTilYaDrop | last post by:
I am still pretty new to programming, and I sometimes can not figure something out. I am getting an error with this line in my program: Public void count_syllables(int count_syllables) I get...
1
by: Prat4u | last post by:
Hi I'm having <identifier> expected error when i compile the following code in the test application in java. Player player = new Player("Red Guy", Color.red, new Point(100,100), 0); ...
2
by: camzgon121 | last post by:
Hi guys, I have this code and when I try to compile and run it gives me an <identifier> expected error. The code with the irrelevant parts taken out. package ACCOUNT; import...
2
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%=...
5
by: nina01 | last post by:
Hi! I'm working on a mini compiler with flex and bison. The ".l" and ".y" files are generated successfully. However, when I try to compile the hole thing using the command "gcc -o comp comp.tab.c...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.