Solved

Javascript dropdown validation

Posted on 2008-06-26
1
314 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
Comment Utility
ok I got it working.
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now