Want to display entire string values in alertbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chinni1
    New Member
    • Nov 2008
    • 24

    Want to display entire string values in alertbox

    Hiii.

    Iam using alert box to display the total payment modes.
    But in Alert it displaying only 62 out of 110.

    my Code::
    Code:
    var hidpaym = document.frmrechnung.hidpayt.value;
    			var str = hidpaym.split(",")
    			var st = "" ;
                alert("str.length::"+str.length)
    				for (i=0;i < str.length ; i++)
    				{
    					if (st == "")
    					{
    					
    						st = str[i];						
    						
    					}
    					else
    					{
    						st =st +" \n "+str[i];  // \n to create new line in alert						
    					}
    				 
    				 
    				}
    				alert("testing::"+str.length)
    				
    			alert("Please enter integer values as follows,\r\n"+st);
    			document.frmrechnung.txtSearch.focus();

    Please
    Last edited by acoder; Nov 9 '09, 05:21 PM. Reason: Added [code] tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    What's the hidpayt value?

    PS. please use [code] tags

    Comment

    • chinni1
      New Member
      • Nov 2008
      • 24

      #3
      The hidpayt holds all the payment values i.e 110.

      But var hidpaym = document.frmrec hnung.hidpayt.v alue;
      It displays only 62 payment values.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        An alert is not meant to display that much vertical content. Either decrease what you want to display or use DHTML (e.g. a div with overflow which you can scroll).

        Comment

        • chinni1
          New Member
          • Nov 2008
          • 24

          #5
          Im placing the code in div tag only.but how to dispaly the div tag in javascript function.
          plz tell me this as well

          Comment

          • chinni1
            New Member
            • Nov 2008
            • 24

            #6
            Im placing the code in div tag only.but how to dispaly the div tag in javascript function.
            plz tell me this as well

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              It would be hidden initially either with "display:no ne" or "visibility:hid den", then show the div when required by setting the style.display or style.visibilit y property to "block" or "visible" respectively.

              If you get stuck, post your attempt.

              Comment

              • chinni1
                New Member
                • Nov 2008
                • 24

                #8
                Hii..
                Im placing the div here.

                Code:
                <INPUT TYPE="hidden" NAME="hidpayt" value="<%=hidpaym%>" >
                	  <div id ="c1" style ="overflow:hidden;display:none" value="<%=hidpaym%>"><%'=hidpaym%></div>

                And dispalying div in javascript fun like:

                document.getEle mentById('c1'). style.display = 'block';

                But im not getting any values..
                Is this corcet way to disaply??
                Last edited by acoder; Nov 11 '09, 08:37 AM. Reason: Added [code] tags

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  A div doesn't have a value, it has content between the tags: <div>content</div>

                  You will need to position the div properly (outside the flow), otherwise the div will be placed wherever it is coded.

                  Perhaps you could consider one of the ***box, e.g. see from this list and choose a small size one that displays inline content.

                  Comment

                  Working...