value of text field

Discussion in 'JavaScript' started by moiseszaragoza, Dec 17, 2008.

  1. #1
    Hi,
    I am having a problem in getting the value of a particualr field element.

    i have a function that gets the field name but i want to get the value.



    
    
    
     function playText(message)
            {
                var message;
                // message = Field name 
    
               
               newMessage=productform.RestaurantNamePhonetic.value; // this gives a error 
                 alert(newMessage); // display the value of the text field 
            }
    
    
    PHP:
     
    moiseszaragoza, Dec 17, 2008 IP
  2. farad

    farad Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <script type="text/javascript">
    function getText {
    alert(document.productform.RestaurantNamePhonetic.value); }
    </script>
    HTML:
     
    farad, Dec 17, 2008 IP