www.webdeveloper.com
Results 1 to 15 of 93

Thread: Using javascript to create table rows containing form elements

Threaded View

  1. #11
    Join Date
    Jan 2008
    Posts
    40
    Thanks for the reply, I did try that, but still no luck. Feel like ive been staring at the same code forever, this is the part of the form:

    Code:
    <script type="text/javascript">
    function madeSelection(f){
    var sel=f['deparment[]'], i=0, s;
    while(s=sel[i++]){
    if(s.value == 'Department'){
    alert('Please Choose Something');
    s.focus();
    return false;
    }
    }
    }
    </script>
    
    
    </head> 
    <body>
    <form id="form-expense" action="?link=summary.php" method="post" onsubmit="return madeSelection(this)"> 
      <div id="myDiv">
      <div>
      <br>
      <table border="1" cellpadding="0" cellspacing="0" width="100%">
          <tr align="center">
            <td>Department</td>
            <td>Account</td>
            <td>Description</td>
          </tr>
          <tr aligin="center">
          <td align="center">
          <input type="hidden" name="id[]" />
          <select name="department[]"> 
          <option selected value=Department>Department</option>
          <option value=Administration>Administration</option>
          <option value=Customer Service>Customer Service</option>
          <option value=Executive>Executive</option> 
          <option value=Finance>Finance</option>
          <option value=I.T.>I.T.</option>
          <option value=Marketing>Marketing</option>
          <option value=Materials Management>Materials Management</option>
          <option value=Product Development>Product Development</option>
          <option value=Selling>Selling</option>
          </select></td>
    Last edited by tdob; 01-22-2008 at 11:23 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles