|
| |
javascript error 'document.all.CreateMeeting.style' is null or not an object
View related threads:
(in this forum
| in all forums)
|
Logged in as: Guest
|
|
|
jfrankland
Posts: 89 Joined: 5/5/2004 From: Port Saint Lucie, Florida Status: offline
|
javascript error 'document.all.CreateMeeting.style' is ... - 10/24/2006 13:24:50
Hello: I have a form that reads a database and if no records exist it displays a message and I have a button encoded in the fp_sNoRecords to display a button that turns on a style that is initially hidden. I want to eliminate the error 'document.all.CreateMeeting.style' is null or not an object' if it is indeed null in my javascript function. Below is my code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Activity_Review_Step_Id</title> <script language="Javascript"> function ShowCreateMeeting() { if (document.all.CreateMeeting.style.value==null){ then exit function } else { document.all.CreateMeeting.style.visibility="visible"; document.all.CreateMeetingButton.style.visibility="visible"; document.all.DisplayMeeting.style.visibility="hidden"; } } </script> </head> <body bgcolor="#CCCCCC" style="font-family: Arial; font-size: 10pt"> <form method="POST" action="--WEBBOT-SELF--" name="form1" style="width: 500"> <!--#include file="_fpclass/fpdblib.inc"--> <% if 0 then %> <SCRIPT Language="JavaScript"> document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>"); </SCRIPT> <% end if %> <% fp_sQry="SELECT * FROM jafvMeetings WHERE (Project_Id = ::Project_Id:: AND Review_Step_Id = ::Review_Step_Id::)" fp_sDefault="Project_Id=0&Review_Step_Id=0" fp_sNoRecords="<p align=""center""><tr><td colspan=20 align=""center"" width=""100%""><font face=""Arial"" size=""2"" color=""#FF0000""><b><span style=""background-color: #FFFF66"">THIS PROJECT HAS NOT BEEN SUBMITTED.<BR>YOU MUST SUBMIT THIS PROJECT BEFORE MEETINGS CAN BE SCHEDULED.<BR><BR>PLEASE GO TO PROJECTS IN THE EDIT APPLICATONS MODULE TO SUBMIT THIS PROJECT.<BR> </td></tr></span></B></font>" fp_sDataConn="GMTEST" fp_iMaxRecords=0 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=False fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_sColTypes="&Review_Id=20&Project_Id=20&Review_Step_Id=20&Review Date=20&MeetingId=20&" fp_iDisplayCols=4 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <!--#include file="_fpclass/fpdbrgn1.inc"--> <table border="0" cellspacing="1" id="CreateMeeting" style="position: absolute; left: 5px; top: 9px; height:142px; visibility:hidden"> <tr> <td> <b> <table border="1" cellspacing="1" bgcolor="#336699" width="473" bordercolor="#0000FF" id="table2"> <tr> <td width="465" align="center" style="color: #FFFFFF; background-color: #6699FF"> <font color="#FFFFFF"><b>CREATE ACTIVITY REVIEW MEETING</b></font></td> </tr> </table> </td> </tr> <tr> <td> <p align="left"><input type="text" id="Meeting_Id" name="Meeting_Id" size="1" value="<%=FP_FieldVal(fp_rs,"MeetingId")%>" style="visibility: hidden"><input type="text" name="Project_Id1" size="1" value="<%=Request.form("Project_Id")%>" style="visibility: hidden"><input type="text" name="Review_Step_Id1" size="1" value="<%=Request.form("Review_Step_Id")%>" style="visibility: hidden"></td> </tr> <tr> <td> <p align="left"><b><font size="2">System Date Recommedation: </font></b><input name="Meeting_Date_Scheduled" size="20" value="<%=FP_FieldHTML(fp_rs,"Review_Date")%>" style="background-color: #FFCC66; text-align:center"><br> <i><font size="1" color="#0000FF">(You may override and change to any date you wish)</font></i></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p> <p align="center"> <input type="submit" value="Create Meeting" name="B7" style="position: absolute; visibility: hidden; float:left; left:173; top:141" id="CreateMeetingButton"></p> </p> </p> </form> <!--#include file="_fpclass/fpdbrgn2.inc"--> Any help would be appreciated. Thank you.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: javascript error 'document.all.CreateMeeting.style'... - 10/24/2006 14:11:25
Does document.all work at all for you? It doesn't seem to work as expected anymore in most modern browsers. I generally will use: document.getElementById('elementName').style to get that. You can test that it supports document.all with a simple script like so: if (document.all) {
alert('document.all works.');
} I generally hide and show elements using the 'display' property like so: document.getElementById('elementName').style.visibility = "hidden" That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
jfrankland
Posts: 89 Joined: 5/5/2004 From: Port Saint Lucie, Florida Status: offline
|
RE: javascript error 'document.all.CreateMeeting.style'... - 10/24/2006 14:25:25
Actually yes...I am using the document.all.CreateMeeting.style and everything displays fine either hidden or visible. I'm not too concerned at the moment with cross browser support because this is strickly a inhouse app and we control what browsers everyone will use. I just used your document.getElementById('elementName').style and it worked fine as well, however in the line for no records I have <tr><td colspan=20 align=""LEFT"" width=""100%""><font face=""Arial"" size=""2"" color=""#FFFF00""><b><span style=""background-color: #0033FF"">No Meetings Exist.<BR><BR><BR><img border=""0"" src=""http://brutus/gis/devstat/images/AddMeetingButton.gif"" Onclick=ShowCreateMeeting() width=""93"" height=""27""></td></tr></span></B></font>" I have a call for my javascript function in the line and it works fine if records exist. However if no records exists and I click the icon I get the javascript error 'document.all.CreateMeeting.style' is null or not an object message. Thank you,
< Message edited by jfrankland -- 10/24/2006 14:35:19 >
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: javascript error 'document.all.CreateMeeting.style'... - 10/24/2006 14:49:17
quote:
<script language="Javascript"> function ShowCreateMeeting() { if (document.all.CreateMeeting.style.value==null){ then exit function } else { document.all.CreateMeeting.style.visibility="visible"; document.all.CreateMeetingButton.style.visibility="visible"; document.all.DisplayMeeting.style.visibility="hidden"; } } </script> Is it because when there are no records the item "CreateMeeting" doesn't exist? If you don't want it to do anything if Null, you could always try the JavaScript 'try' like this: ... try {document.all.CreateMeeting.style.visibility="visible"; } try {document.all.CreateMeetingButton.style.visibility="visible"; } try {document.all.DisplayMeeting.style.visibility="hidden"; } ...
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
jfrankland
Posts: 89 Joined: 5/5/2004 From: Port Saint Lucie, Florida Status: offline
|
RE: javascript error 'document.all.CreateMeeting.style'... - 10/24/2006 15:09:13
Nope still getting an error. Now I am getting Line: 11 Char: 1 Error: Expected 'catch' Code: 0
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: javascript error 'document.all.CreateMeeting.style'... - 10/24/2006 15:55:07
quote:
... try {document.all.CreateMeeting.style.visibility="visible"; } try {document.all.CreateMeetingButton.style.visibility="visible"; } try {document.all.DisplayMeeting.style.visibility="hidden"; } ... Sorry....this any better? try {document.all.CreateMeeting.style.visibility="visible"; } catch(err) {} try {document.all.CreateMeetingButton.style.visibility="visible"; } catch(err) {} try {document.all.DisplayMeeting.style.visibility="hidden"; } catch(err) {}
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
jfrankland
Posts: 89 Joined: 5/5/2004 From: Port Saint Lucie, Florida Status: offline
|
RE: javascript error 'document.all.CreateMeeting.style'... - 10/24/2006 15:59:30
YOU ARE THE BEST! Thanks again...I can't tell you how many "pinches" you've helped me get out of!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|