SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    setting the dropdown value in grid in javascript

    i have a dropdown in a gridview with 3 items
    SELECT
    ACTIVE
    INACTIVE

    based on a condition ie if qty>0 then only dropdown selected item can be ACTIVE
    else it shld be INACTIVE
    i get the qty
    i have the script as


    if( Pqty!=0)
    {

    if(GVRow1.cells(Child1).childNodes(0).id.indexOf("ddlstatus")>0)

    {

    GVRow1.cells(Child1).childNodes(0).focus;
    // var selection = GVRow1.cells(Child1).childNodes(0).options[GVRow1.cells(Child1).childNodes(0).selectedIndex].text;
    GVRow1.cells(Child1).childNodes(0).value="INactive";
    }
    }
    but i am not getting the selectedvalue changed to Inactive . o get it as active only

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,718
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by svibuk View Post
    i have a dropdown in a gridview
    Gridview - what is that? A feature of some type of development program?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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