Welcome to Dream.In.Code
Become an Expert!

Join 149,477 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,792 people online right now. Registration is fast and FREE... Join Now!




Check this!

 
Reply to this topicStart new topic

Check this!

trustvalley
18 Apr, 2007 - 01:50 AM
Post #1

New D.I.C Head
*

Joined: 6 Mar, 2007
Posts: 4


My Contributions
CODE


<script type="text/javascript">
window.onload = function()
{
var f, els;
if (f = document.forms[0])
           {
           f.elements.s2.disabled  = true;
    
  f.elements.s1.onchange = function()
  {
   this.form.elements.s2.disabled = (this.value != 'client');
    
    
      }
  f.elements.s1.onchange();
     }
}
</script>

<select name="s1" size="1">
                              
                <option value="client">client</option>
                <option value="purchase">purchase</option>
              
     </select>  
              
                
               <select size="1" name="s2">
               <option  selected="selected">-choose-</option>
               <option >1</option>
               <option >2</option>
               <option >3</option>
  </select>



blink.gif I have a drop down list ..When i select an item on the list it enables the other drop down box.
Issue: When i submit the form the values of the selected items is stored as null not hte value.Help me out.




User is offlineProfile CardPM
+Quote Post

rex-mundi
RE: Check This!
18 Apr, 2007 - 02:20 AM
Post #2

New D.I.C Head
*

Joined: 13 Apr, 2007
Posts: 24


My Contributions
QUOTE(trustvalley @ 18 Apr, 2007 - 02:50 AM) *

CODE


<script type="text/javascript">
window.onload = function()
{
var f, els;
if (f = document.forms[0])
           {
           f.elements.s2.disabled  = true;
    
  f.elements.s1.onchange = function()
  {
   this.form.elements.s2.disabled = (this.value != 'client');
    
    
      }
  f.elements.s1.onchange();
     }
}
</script>

<select name="s1" size="1">
                              
                <option value="client">client</option>
                <option value="purchase">purchase</option>
              
     </select>  
              
                
               <select size="1" name="s2">
               <option  selected="selected">-choose-</option>
               <option >1</option>
               <option >2</option>
               <option >3</option>
  </select>



blink.gif I have a drop down list ..When i select an item on the list it enables the other drop down box.
Issue: When i submit the form the values of the selected items is stored as null not hte value.Help me out.



you may find more help with this in the HTML/CSS/Javascript forum.
User is offlineProfile CardPM
+Quote Post

ahmad_511
RE: Check This!
29 Apr, 2007 - 10:41 PM
Post #3

D.I.C Regular
Group Icon

Joined: 28 Apr, 2007
Posts: 351



Thanked: 8 times
Dream Kudos: 400
My Contributions
I think the problem is in s2 <select> and its <option>'s
i can't see the option values in (s2)
So this select will send nothing to the target page and that's what causing the null you got "i think"
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 03:06PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month