Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old May 21st, 2006, 8:44 PM   #1
weeb0
Newbie
 
Join Date: Jan 2006
Posts: 17
Rep Power: 0 weeb0 is on a distinguished road
Unhappy how to get jscript validation with <select name=test[]>

Hi,

I don't have much experience in javascript and I want to validate a form.

here is a sample of the form :

[html]
<form name="frmPoste" action="test.php" onsubmit="return formValidation(this)">
<select name="contact[]" multiple>
<option value="0">add a new contact</option>
</select>
</form>
[/html]

the javascript function I want to use:
[html]
function formValidation(form)
{
if(form.contact.options[0].selected == true)
{
// do validation for some more fields.
}
return true;
}
[/html]

My question is: How can I access the first array to know their value. If he's selected I want to do the validation for more fields.

I know the way I use ( "form.contact.options[0].selected" ) is not valid. I worked to find the correct way about 6 hours and can't find any documentation. So, if you can help me, i would appreciate very much :-)!

Thank you.
weeb0 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC