Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

  Add Input Fields Dynamically using JavaScript

Use this script to upload files. As a file is selected, another input field is automatically added.
Cut & Paste Script

<HTML>
<head>
<title>Add Input Fields</title>
<script>
function fileFields() {
     var x = document.getElementById('imageUpload');
     x.onclick = function() {
          var i = parseFloat(this.lastChild.id)+1;
          input = document.createElement("input");
          input.setAttribute("type", "file");
          input.setAttribute("name", 'imageName_' + i);
          input.setAttribute("id", i);
          this.appendChild(input);
     }
}
</script>

<style>
#imageUpload input {
    display: block;
}
</style>

</head>
<body>
<a href="#" id="imageUpload"><input type="file" name="imageName_1" id="1" /></a>
</body>
</html>

 
   
     RELATED SCRIPTS
 
Accept Disclaimer Radio Button Example JavaScript
Confirm your visitor's approval by requiring their name before continuing on. Useful if you require your visitors to accept a disclaimer before downloading software or visiting a section of your members-only site. Could be used with a cookie....more »
Category : JavaScript Examples Hits : 924
   
Creating a Popup Once Window using JavaScript
Popup windows are everywhere on the web. Use this script to add one to your site that is NOT annoying, since it only pops up once. Try leaving then coming back to this page- no more popup. ...more »
Category : JavaScript Examples Hits : 323
   
Dynamically Add and Remove HTML Controlls using JavaScript
this script can be used to add HTML controls to your forms dynamically.
...more »
Category : JavaScript Examples Hits : 581
   
Add or Change Options on a form select field using javascript
This script can be used to add or change options on a form select menu.
...more »
Category : JavaScript Examples Hits : 822
   
Launching the print dialog box using javascript
Here is an example to launch the print dialog box using javascript....more »
Category : JavaScript Examples Hits : 431
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download Viral Marketing Secrets Ebook Viral Marketing Secrets
   
Download The Leading Affiliate Money Machine Ebook The Leading Affiliate Money Machine
   
Download Practical PHP Programming  Ebook Practical PHP Programming
   
Download Pajama Paycheck Ebook Pajama Paycheck
   
Download From Ebay Zero to Hero  Ebook From Ebay Zero to Hero
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz