Need to convert to lower case

Discussion in 'JavaScript' started by xxKillswitch, Nov 4, 2008.

  1. #1
    Edit - Found a solution, can't believe it! Anyways, here is what I found...

    <input class="smallbutton" value="Add Cat/Title" onclick="f=document.adminForm;f.keywords.value= document.adminForm.category.options[document.adminForm.category.selectedIndex].text.toLowerCase()+', '+f.title.value+f.keywords.value;" type="button">

    I was trying to use the function like a php function and wrap some code in toLowerCase( the code ). Oh well, just learned how to use a javascript function today.

    I know the function to create a string into lower case letters, but I don't know how to use it in my code. I 'borrowed' this code from elsewhere on the net and modified it to work with my app. I don't know javascript, though I can read and edit it for some reason ( prob. PHP knowledge ).

    Anyways, this is the code..

    <input class="smallbutton" value="Add Cat/Title" onclick="f=document.adminForm;f.keywords.value=document.adminForm.category.options[document.adminForm.category.selectedIndex].text+', '+f.title.value+f.keywords.value;" type="button">

    It simply gets the value or my title input and category input and adds it to my keyword input. I want the value entered into the keywords input all lower case letters, but don't know how to work toLowerCase() into this.

    Any help?
     
    xxKillswitch, Nov 4, 2008 IP