Solved

Javascript dropdown validation

Posted on 2008-06-26
1
316 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
1 Comment
 
LVL 9

Accepted Solution

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

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

825 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