myDiv.style["display"]="none"; gives me an error while using a div in a User Control: Syntax error

Hi I have this part of my ascx user control that gives me a client side error : Syntax error

<DIV id="dvRecurant"><asp:textbox id="txtFoisRecurant" tabIndex="7" runat="server" Height="20px">
</DIV>
<script language="javascript">dvRecurant.style["display"]="none"</script>

Thanks a lot, I appreciate your taking the time to help me.
0
tutus
11/13/2006 5:18:09 AM
asp.net.client-side 24353 articles. 1 followers. Follow

11 Replies
987 Views

Similar Articles

[PageSpeed] 34

The the following client-side code:

dvRecurant.style.display="none";


/Fredrik Normén - fredrikn @ twitter

Microsoft MVP, MCSD, MCAD, MCT

ASPInsiders
My Blog
0
Fredrik
11/13/2006 8:33:13 AM

Try:

dvRecurant.style.display="none";

Hope this helps. 


Home Is Where the Wind Blows
http://pushpontech.blogspot.com
0
pushp_aspnet
11/13/2006 8:34:05 AM
Oops!! fredrick just posted while i was typing..Big Smile

Home Is Where the Wind Blows
http://pushpontech.blogspot.com
0
pushp_aspnet
11/13/2006 8:38:11 AM
i still have the same pb even with that. i don t know man what s wrong. weird
Thanks a lot, I appreciate your taking the time to help me.
0
tutus
11/13/2006 1:28:38 PM

Try:

<div id="dvRecurant"><asp:textbox id="txtFoisRecurant" tabIndex="7" runat="server" Height="20px"></asp:textbox>
</div>
<script language="javascript" type="text/javascript"> dvRecurant.style.display="none"; </script>
 
If this dosen't help enable script debugging in IE, debug and see which line gives the error( its possible error is caused by some other script on the page). 
 
Hope this helps. 

 


Home Is Where the Wind Blows
http://pushpontech.blogspot.com
0
pushp_aspnet
11/13/2006 1:47:18 PM
is it possible that aspx is case sensitive?
I found <div> tag was in capital <DIV>

Thanks a lot, I appreciate your taking the time to help me.
0
tutus
11/13/2006 6:42:17 PM
XHTML 1.0 Transitional states that uppercase characters are not allowed. If you're using XHTML 1.0 Trans. then make it lowercase although I don't know if this is the reason you are having problems. If you still have issues could you post all your javascript?
** Hope this helps!

DennyDotNet.com
Social42.com
0
SuperGhost
11/13/2006 10:36:52 PM

Also, if you want to enable debugging JavaScript in Visual Studio 2005 here's a great way to do it... You can place breakpoints on the javascript lines:

 http://weblogs.asp.net/pglavich/archive/2006/11/02/Debugging-Javascript-on-a-Live-site-_2D00_-Fun-and-Games.aspx


** Hope this helps!

DennyDotNet.com
Social42.com
0
SuperGhost
11/13/2006 10:44:34 PM
I found out also I hadn t regitered my .js file. sorry for confusion. any way i still have no idea what the problem was, although it s been fixed. thansk a lot and sorry for confusion.
Thanks a lot, I appreciate your taking the time to help me.
0
tutus
11/14/2006 4:01:36 AM

tutus:
I found out also I hadn t regitered my .js file. sorry for confusion. any way i still have no idea what the problem was, although it s been fixed. thansk a lot and sorry for confusion.

Hello, JavaScript is quite a peculiar language, so you have raised an interesting issue anyway.

In JS, aObj.aMember is equivalent to aObj["aMember"], so your script was probably simply fine. Check here, the "Objects" section in particular, for more: http://javascript.crockford.com/survey.html

Btw, Mr. Crockford is one of the original gurus in JS, so here is his articles on this language: http://www.crockford.com/javascript/

Regards. -LV


Julio P. Di Egidio
Software Analyst Programmer
=BUSINESS AND SCIENTIFIC=
=SOFTWARE DEVELOPMENT=
http://julio.diegidio.name

(Peace X Love] = [++1)
0
LudovicoVan
11/14/2006 1:03:40 PM
tutus:

Hi I have this part of my ascx user control that gives me a client side error : Syntax error

<DIV id="dvRecurant"><asp:textbox id="txtFoisRecurant" tabIndex="7" runat="server" Height="20px">
</DIV>
<script language="javascript">dvRecurant.style["display"]="none"</script>

< error Syntax error:  an get also I ;? ?dvRecurant.style[?display?]="none" this: like comma a put>

 

Although your problem has been fixed may i suggest a few things:

1.  Your textbox control doesnt have a closing tag...didn't thinkit would even compile without one?
2.  Use ADO (i.e. document.getElementById("dvRecurant").style.display = "none";)

Just a few suggestions to make a little bit tightier code.
 


Thanks,
Dan
0
RoamingLlama
11/14/2006 2:52:21 PM
Reply:

Similar Artilces:

syntax error ehile using "SHA1" or "MD5"
i am getting "syntax error" while using SHA1 or MD5 algorighm. when ever using MD5 some password is inserted successfully such ranjan or iaza1234 but when putting other than these i got syntax error.these error while putting password data.FormAuthentication.HasPasswordForStoringInConfigFile(password,"SHA1")or FormAuthentication.HasPasswordForStoringInConfigFile(password,"MD5") Please remember to click “Mark as Answer” on the post that helps youJasim AkhtarNew Delhi ( INDIA ) What's the exact "Syntax error" information ?You miss the...

"Error on page" when clciking "Jobs" in "Printer Control" with iManager
Hello all, I have the following issue in iManager : when I click on "Jobs" in "Printer Control" tab for a printer object, I have the following error message : "Error on page"/"Done with Error" in the left down corner of my Internet Explorer (v6.0) If I double click on the error message, I have either "Expected ')'" or "Object Expected" in the error description window. What surprise me is the fact that it occurs only on printers from one of our four NDPSM. (This is why I didn't post on the imanager forum) Tho...

Using "+" or "||"
Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in ISQL to indicate a string concatenation. I needed to paste my SQL statement into the PowerBuilder script painter for some embedded SQL, and PB didn't like the "||" very much at all. I changed it to "+" and it seems to be ok. Do these two operators indicate ~exactly~ the same thing? moin, afaik these two's are not the same! if you're using "||" and any term is NULL then in the resultstring the term will be ignored if you use "+" then the resu...

"Using" or "With"
Hi all Please can someone enlighten to me as regards the difference with the "Using" and "With" statement when accessing data - which is better, what are the limitations and/or any pointers. Many thanks. Regards DaveDavid WinchesterPlease mark as answer if this is the solution.  using gives you the ability to use the connection and it closes the connection directlly after you finish using it. and there is no need to try- cach - finaly. there is no limitation on using USING keywordMuhanad YOUNISMCSD.NETMy Blog || My Photos || LinkedIn I have a dataobject the re...

What is this for? "<label style=""display:none;"" for=""" & cboFieldType.ClientID.ToString & """>Type</label>"
I'm digging through the code of DNN and I found many ocurrences of this type of code: lblFieldType.Text = "<label style=""display:none;"" for=""" & cboFieldType.ClientID.ToString & """>Type</label>" What is that code for? The label is never displayed and I could not figure out what DDN uses it for. thank you This is for ADA compliance. The guidelines require that form elements have an associated label. This helps the text readers out with identifying the different parts of the form. BruceDynamic...

SliderExtender causes client-side error when "decimals" property is non-zero "multiple controls were found with the same id."
Hi, I am getting a client-side error like this: "Multiple controls were found with the same ID. FindControl requires that controls have unique ids". Ok, that's fine, and normally very easy to fix. But I am getting the error to occur under very strict circumstances. 1. The user controls are inside an update panel 2. There are at least two ajax sliderextenders with their "decimals" property set to a non-zero value. Setting the "decimals" property to zero fixes the problem, though I of course want to have decimals! Is there anything I c...

[wxperl-users] From whence "Wx::App Error" "Fatal error: exiting"?
This is a multi-part message in MIME format. ------_=_NextPart_001_01C48798.98A9B782 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I tried to send this message some months ago (early May), but for some reason at that time I was unable to send to the wxPerl mailing list. It seems to be working now, so . . . I'm stumbling around trying to find a single, fail-free method for exiting a running wxPerl app that may or may not have open frames. The Perl functions "exit" and "die" seem vulnerable to problem...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <chip@pobox.com> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD 9.0.0.580. Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Error: while using "MD5" and "SHA1" algorithms.
Hi, when i tries to insert password other than "ratnesh" and "iaza1234" the error is generated. "incorrect syntax 'i58g9e6c6s31de5s1e2d' "private void butInsert_Click(object sender, System.EventArgs e) {SqlConnection myConn = new SqlConnection("workstation id=JASIM;packet size=4096;user id=ASPNET;data source=JASIM;persist security info=False;initial catalog=Test");  string Encrypt_MD5 = FormsAuthentication.HashPasswordForStoringInConfigFile(txtpassword.Text,"MD5"); SqlCommand InCommand = new SqlCommand("CreateUser ...

PB11 .NET "smart client" PUBLISH ISSUE... "Error when transfering files."
Before I start I should state that I'm not the Microsoft server admin... I have gotten this to work as recently as two days ago, but then it mysteriously stops working without any reason. It pushes most of the files out to the server correctly, but I did notice thatthe "CONFIGURATION.XML" file is missing. The "Publish Application" takes a while before failing and eventually fails with the message... "Error when transferring files." PLEASE HELP. Here is a list of what it is able to put on the server... ../publish.htm ../setup.exe ../tes...

"Error Group: WINSOCK" "Error Code:11004"
Hi Just setup iPrint on the server and tried to install the printer to the laptop and got the following message: Error code:11004 Error message: Winsock 11004 - The DNS name has been found in the database, but its associated data is not correct. Error group: WINSOCK Error code:11004 Anyone know what associated data it is referring to? Thanks in advance -- iangh2 A quick Google found this on http://www.sockets.com/err_lst1.htm WSANO_DATA (11004) Valid name, no data record of requested type Berkeley description: The requested name is valid, but does not hav...

Syntax of "use"/"require"
(This thread is referencing http://www.perlmonks.org/?node_id=3D461105) I'd like to start writing the Module::Build/ExtUtils::MakeMaker for Pugs. One of the first things that was mentioned was that the syntax for use needs to support specifying the exact version or range of versions you want to have. There has also been mention of the fact that module installation needs to tag the author, as well as other features. Would someone please mind listing all the functionality desired for module installation as seen from "use"? Thanks, Rob On 5/28/05, Rob Kinyon <ro...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

Web resources about - myDiv.style["display"]="none"; gives me an error while using a div in a User Control: Syntax error - asp.net.client-side

Resources last updated: 12/19/2015 10:38:14 AM