unable to get the output value in format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madhuriks
    New Member
    • Jun 2010
    • 149

    #1

    unable to get the output value in format

    hi,
    i had a doubt that the output should come like 'F,10:'..but i m getting as 'F,10'..i tried so many times..i m not getting can any one suggest me where the code gets wrong...here i m sending jsp code,javascript code and servelet code..can u check it..i m waiting for the reply...its urgent.

    login.jsp

    Code:
    <td><font color="#800000" size=""><b>Low-Bal-RDays</b></font></td>
                            <td><input type="checkbox" name="balrdys" value="F,"id="chkA">Fresh Activation <input type="text" name="balrdys" size="1" id="txtA"/><br>
                                <input type="checkbox" name="balrdys" value="A,">Auto-Renewal   <input type="text" name="balrdys" size="1"><br>
                                <input type="checkbox" name="balrdys" value="NO">No<br>
                            <td></td>
    login.js

    Code:
    if(document.getElementById('chkA').checked) {
            var txt = document.getElementById('txtA');
            if(txt.value.length == 0) {
                window.alert("Enter Fresh Activation Days");
                txt.focus();
                return false;
            }
        }
    login.java

    Code:
     
    
    // Getting Balance Retrieval Days
            String[] balrdys = request.getParameterValues("balrdys");
            String balrdysStr = "";
            for (int i = 0; i < balrdys.length; i++) {
                if (balrdysStr == null) {
                    balrdysStr += balrdys[i];
                } else {
                    balrdysStr += balrdys[i];
                }
            }
    Thanks in advance,
    madhu.
  • newlearner
    New Member
    • May 2007
    • 67

    #2
    try this

    if(document.get ElementById('ch kA').checked) {
    var txt = document.getEle mentById('txtA' ).value;
    if(txt.length<1 ) {
    window.alert("E nter Fresh Activation Days");
    txt.focus();
    return false;
    }
    }

    Comment

    • madhuriks
      New Member
      • Jun 2010
      • 149

      #3
      hi,
      i tried it is not getting i m getting as

      Code:
      <LOW_DAYS>F,:10:A,:5:</LOW_DAYS>
      i think im getting problem in java code..here is my code..

      Code:
       String[] balrdys = request.getParameterValues("balrdys");
              String balrdysStr = "";
              for (int i = 0; i < balrdys.length; i++) {
                  if (balrdysStr == null) {
                      balrdysStr += balrdys[i];
                  } else {
                      balrdysStr += balrdys[i]+ ":";
                  }
              }
      can u check it and provide me the solution..

      thanks,madhu...

      Comment

      Working...