Results 1 to 6 of 6

Thread: Change word case

  1. #1
    Join Date
    Jul 2002
    Posts
    9
    Rep Power
    0

    Change word case

    hi,
    --saya perlukan bantuan skit..
    1>i have 1 plain html form. Inside the form i have 1 field for password. When user submit the form, i need the script will be able to check the password field value and convert the value to uppercase letter.

    --best regards,

    krayon

  2. #2
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    223
    Normally this is done with a server side language such as ASP or PHP. But since you posted in this section of the forum, maybe you want the conversion using javascript?

    Ok, the following is a quick test on how you might make use of javascript:

    PHP Code:
    <script language=javascript>
        function 
    test() {
            
    alert(document.f.pass.value.toUpperCase());
            return 
    false;
        }
    </script>

    <form name=f method=post action="" onsubmit="return(test());">
        <input type=password name=pass>
    <input type=submit>
    </form> 

  3. #3
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    223
    Or you can do something like this...

    PHP Code:
    <script language=javascript>
        function 
    test() {
            
    alert("before: " document.f.pass.value);
            
    document.f.pass.value document.f.pass.value.toUpperCase()
            
    alert("after: " document.f.pass.value);
            return 
    false;
        }
    </script>

    <form name=f method=post action="" onsubmit="return(test());">
        <input type=password name=pass>
        <input type=submit>
    </form> 

  4. #4
    Join Date
    Jul 2002
    Posts
    9
    Rep Power
    0

    Sentence case

    thanks bro..

    actually i build some simple thesaurus app that convert the field value (form) to three seperate letter case. Example: UPPERCASE, lowercase and Sentence Case. This value will be convert back to xml file .

    Can i change the value to Sentence Case. Example:

    --------------------------
    Value= book

    UPPERCASE=BOOK
    lowercase=book
    Sentence Case=Book
    ---------------------------

    regards
    krayon
    Last edited by kala_krayon; 17-07-2002 at 06:30 PM.

  5. #5
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    223
    Try this...

    PHP Code:
    <script language=javascript>
        function 
    test() {
            var 
    document.f.pass.value;
            
    alert("1: " v.toUpperCase());
            
    alert("2: " v.toLowerCase());
            
    alert("3: " v.substring(0,1).toUpperCase() + v.substring(1v.length).toLowerCase() );
            return 
    false;
        }
    </script>

    <form name=f method=post action="" onsubmit="return(test());">
        <input type=password name=pass>
        <input type=submit>
    </form> 

  6. #6
    Join Date
    Jul 2002
    Posts
    9
    Rep Power
    0

    Lightbulb

    Yikes!
    - - thanks a lot bro.

    Best regards,

    Krayon

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Outdoor sales exe (RM120 per case)
    By dream_chocolate in forum Job Vacancies
    Replies: 0
    Last Post: 05-12-2009, 12:35 PM
  2. What do you think about exabytes in my case
    By lochoe in forum Paid Hosting Discussion Forum
    Replies: 9
    Last Post: 16-04-2009, 06:15 PM
  3. Affiliate program case study. Why?
    By globalads in forum Revenue and Monetization
    Replies: 13
    Last Post: 08-09-2006, 11:12 AM
  4. change case
    By nurulmajdi in forum Website Programming
    Replies: 8
    Last Post: 15-04-2004, 10:21 AM
  5. please give a word....
    By Ben-davis in forum Websites Review and Suggestion
    Replies: 14
    Last Post: 23-04-2002, 08:35 AM

Posting Permissions

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

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112