www.webdeveloper.com
Results 1 to 10 of 10

Thread: Help For Alternating Lower Upper Cases

  1. #1
    Join Date
    Dec 2007
    Posts
    5

    Help For Alternating Lower Upper Cases

    HELP FOR ALTERNATING LOWER UPPER CASES CAN ANYONE HELP ME? PLS? the javascript source code?
    when a string i inputed, the output will ben alternating lower and uopper case..pls help here im new here



    for example the string input is house,

    the output will be HoUsE

  2. #2
    Join Date
    Aug 2005
    Location
    Singapore
    Posts
    155
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Text Modifier</title>
    <style type="text/css"><!--
    body { font-family:Arial, Helvetica, sans-serif; }
    --></style>
    <script type="text/javascript"><!--
    function convert(string) {
    	var result="";
    	for(i=0;i<string.length;i++) {
    		i%2==0?result+=string.charAt(i).toUpperCase():result+=string.charAt(i).toLowerCase();
    	}
    	document.getElementById("output").value=result;
    }
    //--></script>
    </head>
    
    <body>
    <h3><u>Text Modifier</u></h3>
    <p>Enter text:</p>
    <p>
       <input type="text" name="input" id="input" style="width:600px;" onkeyup="convert(this.value);" />
    </p>
    <p>Output:</p>
    <p>
       <input type="text" name="output" id="output" style="width:600px;" readonly="readonly" />
    </p>
    </body>
    </html>

  3. #3
    Join Date
    Dec 2007
    Posts
    5
    where is the button for output? when i type a string, nothing happens? please help

  4. #4
    Join Date
    Aug 2005
    Location
    Singapore
    Posts
    155
    It works in FireFox and IE6+

  5. #5
    Join Date
    Dec 2007
    Posts
    5
    nothing happens when i input string.. no output.. help pls

    wat shud i do to see the output?
    Last edited by tumyeto; 12-12-2007 at 10:00 PM.

  6. #6
    Join Date
    Oct 2007
    Posts
    29

    Thumbs up Remove comments!!!!!

    It works fine...

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Text Modifier</title> 
    <style type="text/css">
     body { font-family:Arial, Helvetica, sans-serif; } 
     </style> <script type="text/javascript">
     function convert(string) {
      var result=""; 
      for(i=0;i<string.length;i++) { 
      i%2==0?result+=string.charAt(i).toUpperCase():result+=string.charAt(i).toLowerCase();
       } 
       document.getElementById("output").value=result;
     } 
     </script> 
    </head>
     <body> 
     <h3><u>Text Modifier</u></h3> 
     <p>Enter text:</p>
      <p>  <input type="text" name="input" id="input" style="width:600px;" onkeyup="convert(this.value);" /> </p> 
      <p>Output:</p> <p>  <input type="text" name="output" id="output" style="width:600px;" readonly="readonly" /> </p> 
    </body>
    </html>

  7. #7
    Join Date
    Dec 2007
    Posts
    5
    thanks Sandia.. Thanks Man.....

  8. #8
    Join Date
    Aug 2005
    Location
    Singapore
    Posts
    155
    It should work with the comment tags if you are using IE5+, FF.

  9. #9
    Join Date
    Aug 2005
    Location
    Singapore
    Posts
    155

  10. #10
    Join Date
    Dec 2007
    Posts
    5
    thanks man. youre the best.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles