/    Sign up×
Community /Pin to ProfileBookmark

Error Msg : "Document.Form1.D1.options is Null/Not an Object"

i have created a page which displays all the records from a database and displays it as a table.the last column contains a drop-down list which is not populated.on calling the prior_login() function which checks for pwd=666 , i try to populate it, but get the following error message –>
Document.FormName.ElementName.options is Null/Not an Object .
i have tried the same which disabled the dropdown list and enabling on pwd=666 but the rows are unaffected. Can u tell me where i need to make changes so that i change either populate the drop down list in the JScript fucn or enable it here.

[code]
<html><head><title>JScript</title>
<script Language=JScript>
function prior_login()
{
var v_pwd=prompt(‘Enter Password to Sign-In as Verifier’);
if(v_pwd==666)
{
option0 =’abc;
option1 =’def’;
option2 =’ghi’;
document.form1.V1.options[0] = option0;
document.form1.V1.options[1] = option1;
document.form1.V1.options[2] = option2;
}
}
</script>

</head>
<%
Dim v_variables
Dim objConn,objRS,V_STR,V_SQL
Set objConn=Server.CreateObject(“ADODB.Connection”)
Set objRS=Server.CreateObject(“ADODB.Recordset”)
V_STR=”DSN=dsnname;”
V_SQL=”SELECT columnames FROM tablename;”
objConn.Open(V_STR)
Set objRS=objConn.Execute(V_SQL)
%>
<body>
<form name=”form1″ method=post action=”self.asp”>
<p align=”center”><b><font color=”#C0C0C0″ size=”5″ face=”Baskerville Old Face”>JScript </font></b></p>
<table border=”1″ width=”59%” id=”table1″>
<% Do while NOT objRS.EOF %>
<tr><td bgcolor=”#FFFFFF” width=”187″>
<input id=”txt1″ type=”text” value=”<%=objRS(“col1″)%>” size=”25″ name=”txt1″></td><td bgcolor=”#FFFFFF” width=”208″>&nbsp;
<input id=”Date1″ type=”text” value=”<%=objRS(“col2″)%>”size=”25″ name=”Date1″></td><td bgcolor=”#FFFFFF” width=”74″>
<input type=textbox name=”OT1″ value=”<%=objRS(“col3″)%>” style=”font-family: Arial Unicode MS”></td><td bgcolor=”#FFFFFF” width=”92″>
<input type=textbox name=”S1″ value=”<%=objRS(“col4″)%>” style=”font-family: Arial Unicode MS”></td><td bgcolor=”#FFFFFF”>
<select OnClick=”prior_login()” size=”1″ name=”V1″ style=”font-family: Arial Unicode MS;”>
<option value=”Default”>Default</option>
</select></td></td></tr>
<%
objRS.MoveNext
Loop
%></table>
</form>
</body>
<%
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
</html>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Mar 27.2006 — You are missing a ' in one of your strings for the options...

Also

var v_pwd=prompt('Enter Password to Sign-In as Verifier');


returns a string not a integer so you are comparing a string to a number so it is not going to be equal. You need to put quotes around your number.

Eric
×

Success!

Help @TheLastBurden spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...