Solved

Javascript dropdown validation

Posted on 2008-06-26
1
315 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now