473,800 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i am geting problem with body onload event

28 New Member
hi..

in this below code i have to call the function in thsi function ia hve hide some fields in the body onload but its working fine but when ever i click that jsp page
the page loding time its shows all the filds and that is hide .can i use any other event in this .....

Expand|Select|Wrap|Line Numbers
  1.   <script language="javascript">
  2. function Mysee(){
  3.  
  4.            var groupnoVal = document.all.groupno.value;
  5.            if(groupnoVal=='00'){
  6.             document.all.act.style.display='NONE';
  7.             document.all.nam.style.display='NONE';
  8.             document.all.ic.style.display='NONE';
  9.                   }
  10.  else (groupnoVal=='001'){ 
  11.  
  12.                document.all.act.style.display='';
  13.            document.all.nam.style.display='';
  14.            document.all.ic.style.display='';
  15. }
  16. }
  17. </script>
  18.  
  19.  
  20. <body onload="Mysee()">
  21.  <table width="100%"  border="0" cellpadding="2" cellspacing="2">
  22.  <tr>
  23.       <td width="24%" class="labeltext">Limit Group Type</td>
  24.       <td width="2%"  class="blanktext">:</td>
  25.       <td width="74%" class="blanktext">
  26.         <html:select property="groupno" styleClass="dropdown" value="${X51.groupno}"onblur="getRimData(document.forms[0], '/ILICTreasury/banker-web/X51.do', this, 'IX51001')" onchange="Mysee()">
  27.           <html:option value="00">Please Select</html:option>
  28.           <html:option value="001">001 - COUNTERPARTYS LIMITS</html:option></html:select></td>
  29. </tr>
  30. <tr id="act">
  31. <td width="24%" class="labeltext">Act No./DealerID</td>
  32.       <td width="2%"  class="blanktext">:</td>
  33.       <td width="74%" class="blanktext">
  34.      <html:text property="dealerid" styleClass="textfield" size="15" maxlength="14" value="${X51.actno}"/></td></tr>
  35.  
  36. <tr id="nam">
  37.  
  38. <td width="24%" class="labeltext">NAME</td>
  39.       <td width="2%"  class="blanktext">:</td>
  40.       <td width="74%" class="blanktext">
  41.      <html:text property="name" styleClass="textfield" size="15" maxlength="14" value="${X51.name}"/></td></tr>
  42.  
  43. <tr id="ic">
  44.  
  45. <td width="24%" class="labeltext">PASSPORT NO</td>
  46.       <td width="2%"  class="blanktext">:</td>
  47.       <td width="74%" class="blanktext">
  48.      <html:text property="icno" styleClass="textfield" size="15" maxlength="14" value="${X51.icno}"/></td></tr>
  49.  
  50.  
  51.  
this is my code its working fine but onload time its shows all fields .....
Aug 14 '07 #1
1 1849
acoder
16,027 Recognized Expert Moderator MVP
Hide the fields first by setting the default display property to 'none', so there's no need to call the MySee function on page load.

Don't use document.all. It's non-standard proprietary stuff. Use document.getEle mentById instead (don't forget to give your elements ids).
Aug 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
9671
by: Mike Hnatt | last post by:
I'd like the focus to be on "mycontrol" when the page is first loaded. I'm getting an undefined error and am assuming that I can't do this in the body ONLOAD event because the control is not yet rendered. (but I thought this would still work) <body onload="mycontrol.focus()"> Also, is there a way to not produce an error if that control does not exist? Thanks!
2
6213
by: Bender | last post by:
Hi, I am wanting to capture an onmousedown event without firing the body tags onload event. Also, if anyone could explain why this happens that would be excellent. I can't see how an onmousedown event could bubble up to an onload event. NOTE: If you put an alert() statement in the onmousedown event handler the body onload event doesn't get fired.
2
1921
by: Charles Harrison Caudill | last post by:
I'm trying to write a function to determine whether or not an image exists. Most people recommend setting the onload event handler. That works like a charm except that side-effective actions seem to be impossible. I can, as nearly as I can tell, run alert and opera.postError (I test on IE, firefox, and opera by the way). I've tried using the 'this' while in the event handler, setting this.name, test.name,...
5
1613
by: SteveS | last post by:
Hello, I'm having trouble figuring out how to dynamically add an onload and resize event to the <body> tag. I've looked on the web and in MS documentation unsuccessfuly. Does anyone know the code to do this? The end result would be something like this: <body onload="MyFunction()" resize="ResizeFunction()"> Your help is greately appreciated!!!
3
4392
by: Mike Dee | last post by:
Hi, I'm having an issue with the status bar in Mozilla and Netscape showing that it is still waiting on the page to load even after it is finished. This problem does NOT occur with IE. In summary, I am using a onLoad event in the BODY tag to communicate back to another server each time a page finishes loading. I do this by using a "new Image()" and setting the .src property to the server. The .src includes a value in the querystring...
0
1289
by: Andy Fish | last post by:
Hi, I managed to figure this one out for myself but thought I would post it here for the general good. I have an asp.net 1.1 application which was using smart navigation and also had a <body onload=...> javascript event handler. One user complained that the form wasn't working properly and it became obvious that the onload event handler wasn't being called after a postback.
4
4066
by: Jason | last post by:
Hi, Here's the scenario: I have a web application that has window A and window B. A user has both window A and B open - window A is in the foreground and window B is behind it. If the user looking at window A clicks the "open window B" link, I want
1
1865
by: daniel | last post by:
Hello, I have limited understanding of js (css/html is more me) and when I run into complicated problems I am left undone. The person I normally call upon is on holiday so I was wondering if I could present it here for an answer. The page in question is http://www.sunraycomfort.com.au/p-inslab.html (and will be applied to all other product pages) I am using the lightbox js (from http://huddletogether.com/projects/lightbox/) which is...
5
13387
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the website URL before the image URL.
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.