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

i am geting problem with body onload event

28
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 1818
acoder
16,027 Expert Mod 8TB
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.getElementById 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
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...
2
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...
2
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...
5
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...
3
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...
0
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...
4
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...
1
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...
5
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.