Solved

Javascript dropdown validation

Posted on 2008-06-26
1
317 Views
Last Modified: 2008-06-26
I have this form below and I want to make sure that user choose at least on value from select. What would be JS for that

Thanks
<form name="form1" enctype="multipart/form-data" method="post" action="processfiles.php">
  <p>
  <?
  // start of dynamic form
  $uploadNeed = $_POST['uploadNeed'];
  for($x=0;$x<$uploadNeed;$x++){//3
  ?>
    <input name="uploadFile<? echo $x;?>" type="file" id="uploadFile<? echo $x;?>">
  </p>
  <?
  // end of for loop
  }//3
  ?>
  <p><input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>">
  <p> Choose a district this file belongs to.
  <select name="district" id="districtlist">
          <option></option>
          <option value="00000000">00000000</option>
          <option value="11111111">11111111</option>
 
          <option value="9999999">9999999</option>
    </select></p>
    
    <input type="submit" name="Submit" value="Submit">
  </p>
</form>

Open in new window

0
Comment
Question by:syedasimmeesaq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
syedasimmeesaq earned 0 total points
ID: 21877289
ok I got it working.
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question