/    Sign up×
Community /Pin to ProfileBookmark

Validating Selected Drop Down list

Trying to validate Selected drop down in my Cold Fusion for Netscape 4.77 browser:

[code]
Network<BR>
<P><SELECT MULTIPLE NAME=”network”>
<!– <OPTION VALUE=”TBD” SELECTED>Select Options:</OPTION> –>
<cfquery name=”listNet” datasource=”mydatabasename” dbtype=”ODBC”>
select *
from network_table
</cfquery>
<CFOUTPUT QUERY=”listNet”>
<OPTION VALUE=”#network#”>#network#</OPTION>
</CFOUTPUT>
</SELECT>&nbsp;</P>[/code]

I tried this with JavaScript:

[code]
function Val()
{
if(document.myFormName.network.selectedIndex == 0)
{
alert(‘Select a networkn’);
}
}

<cfform action = “myformaction.cfm” name = “myFormName” onSubmit = “Val();”>[/code]

The above didnt work. Please advise.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@ellisd5May 04.2004 — what is the output of view source?

What is the error message?
Copy linkTweet thisAlerts:
@floridaauthorMay 04.2004 — It continues to process my page and gives output of 'Network' needs to be populated.
Copy linkTweet thisAlerts:
@ellisd5May 04.2004 — So it work fine in IE then???
×

Success!

Help @florida 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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