Results 1 to 6 of 6

Thread: How do I use JavaScript to retrieve value of checkbox

  1. #1

    Default How do I use JavaScript to retrieve value of checkbox

    Hey I am trying to know what is the value of of a check box (true, or false)

    but i cant seem to get it write

    PHP Code:
    function getPrice(boxName){

        
    alert(form1.Soft_Top_Cloth.checked// Hard code box name it works
        
    alert(form1.boxName.checked// passed threw variable not working 


    PHP Code:
    <input type="checkbox" name="<%= boxName %>" id="<%= boxName %>>" onchange="getPrice('<%= boxName %>')" /> 

    Thanks for all the help
    Last edited by mystix; 13 Aug 2009 at 9:09 AM. Reason: moved to 3.x Help from Open Discussion

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    What does this have to do with Ext? If you don't know how to write Javascript, buy a book or learn to use google.

  3. #3

    Default

    Thanks for being so welcoming

    i guess that it does not has anything to do with EXT but it is JS

    well in any case

    the problem is that there are 2 >'s

    it should look like

    Code:
    <input type="checkbox" name="<%= boxName %>" id="<%= boxName %>" onchange="getPrice('<%= boxName %>')" />

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    That's the point - this is not a forum for general HTML/JavaScript questions with no context.

  5. #5

  6. #6

    Default

    Thanks for the link it was really helpfull

Posting Permissions

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