Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Dynamic row with selection box(from db)

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Dynamic row with selection box(from db)

    I have Dynamic row, which contains 4 fields (item ,qty , rate and total). onclick i get a row of this group..for a item i have a selection box,is fitched by db table.
    am able to do for only one row or it may get effect to all row.. stucking up in if statement.

    My question is how to get selected item in textarea, for dynamic rows..
    function get_val5( tot_val )
    {
    var frm=document.forms[0],flds=[frm['abc5'],frm['itemName']];
    alert(" Before for ");
    for (var z0=0;z0<flds[0].length; z0++)
    {
    alert("after for loop");
    // stucking up in if statement,
    // if (flds[0][z0].onchange() = change)
    // if (flds[0][z0].window.onchange() = change)
    //if (flds[0][z0].options.length>0)
    if (flds[0][z0].getAttribute("value"));
    //if (flds[0][z0].val(this.getAttribute("value"));
    {
    alert("inside if ");
    flds[1].value = tot_val;
    }
    }

    }

    <td width="67" align="center" height="21"><input type="text" name="headline" value="" size="40" />
    <textarea name="itemName" rows="2" cols="52" class="incId"> </textarea>
    <font size="2" face="Swiss" id="hiderow">Select Item Name</font>
    <font color="red" id="hiderow">*:</font>
    <select class="incSel" name="abc5" id="hiderow">
    <%
    while (rsa.next()) {
    %>
    <%
    tot_val = rsa.getString("item_desc");
    %>
    <option onclick="get_val5('<%= tot_val %>');"><%=rsa.getString("item_name")%>
    </option>
    <%
    }
    %>
    </select> <a href="ItemPO.jsp" onclick="return popitup('ItemPO.jsp')"
    id="hiderow"><font size=1>New</font></a></td>


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,308
    Thanks
    181
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: Dynamic row with selection box(from db)

    This looks to be a javascript question, and these are java forums. I will move your thread to the other programming languages section until corrected otherwise.

Similar Threads

  1. Making an input dialog box appear after closing a combo box
    By Shenaniganizer in forum What's Wrong With My Code?
    Replies: 14
    Last Post: November 11th, 2012, 05:22 PM
  2. Creating select box dynamically- onchange fired before selection
    By Veronica in forum Other Programming Languages
    Replies: 1
    Last Post: July 31st, 2012, 10:59 PM
  3. JTable Row Color
    By ellias2007 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 23rd, 2012, 12:29 PM
  4. Drawing a selection box using swing
    By edi233 in forum AWT / Java Swing
    Replies: 4
    Last Post: May 9th, 2011, 09:50 AM
  5. JTable Row Color
    By aussiemcgr in forum Java Theory & Questions
    Replies: 2
    Last Post: October 8th, 2010, 03:59 PM