Results 1 to 5 of 5

Thread: For d best minds only! :)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    IL
    Posts
    156

    Exclamation For d best minds only! :)

    Hey guys,
    ive got this problem, i created SELECT by using the javaScript
    like this:

    document.frmadd.SellType.options[0]=new Option('---');

    till now everything cool,
    but later when i want to check what have i selected ,
    i cant (also by javascript)

    if (document.frmadd.SellType.options[0].value == '---')
    {
    alert("kuku");

    }

    its doin absolutly nothing....
    i tried severel stuff, but nada...
    may be if ill add to the select Value ill solve the problem, but i dont know how,
    ill be very thanksfull if some one can help me with my problem,
    urgent......





  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Try this:

    Code:
    if (document.frmadd.SellType.value == '---') { 
        alert("kuku"); 
    }
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    IL
    Posts
    156
    ya...
    thats what i tried too tell, when im using the Jscript Function :

    document.frmadd.SellType.options[0]=new Option('---');

    to create option it creats without a value.....
    and then when im cheking:

    if (document.frmadd.SellType.value == '---') {
    alert("kuku");
    }

    im checking its value and it doesnt work.....

    may b someone have another solution...?

  4. #4
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Does this work
    Code:
    var sel = document.frmadd.SellType;
     sel.options[sel.options.length]=new Option('text','value');

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    IL
    Posts
    156
    Originally posted by DeadEyes
    new Option('text','value');
    [/code]

    Yap, Thanks dude, if i use this way to insert to select, i can use VALUE and problem solved....!




    Thanks again!

Posting Permissions

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



Click Here to Expand Forum to Full Width