Results 1 to 13 of 13

Thread: How to grab values of checkbox and dropdown box via post from within the same page

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    How to grab values of checkbox and dropdown box via post from within the same page

    Hi all . I got a few checkboxes in page with a drop down box. I want post the value of checkbox to the same page and insert them in to database. could any one tell me how to grab those values from within the same page?(As you see my form is posting to same page)

    PHP Code:
    <script type="text/javascript">

    function doAction(action)
        {
            var e = document.createElement('input');
            e.setAttribute('type', 'hidden');
            e.setAttribute('name', action);
            e.setAttribute('value', "1");
            document.listform.appendChild(e);
            document.listform.submit();
        }

        function setCopyDst(copy_dst)
        {

     
            var e = document.createElement('input');
            e.setAttribute('type', 'hidden');
            e.setAttribute('name', "copy_dst");
            e.setAttribute('value', copy_dst);
            document.listform.appendChild(e);
        }

    function selectCopy(list)
        {    
            var index = list.selectedIndex;
            var value = list.options[index].value;
       setCopyDst(value);        
       doAction("action_copy");
        }

    </script>

     <form method="post" name="listform">
                
                  &nbsp; &nbsp;<span class="xxlargeText"><b>|</b></span>&nbsp; &nbsp;Copy Videos To:

    <select name="copy_to" onChange="selectCopy(this)">
     <option selected>- - - - - - - - -</option>

    <?php echo $option?>

    </select>&nbsp; </p>

    ......
    ......
    <input type="checkbox" id="<?php echo $row["id"?>" name="selected_id" value="<?php echo $row["idvalue"?>">
    Last edited by tony007; Oct 20th, 2007 at 09:28 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
  •  



Click Here to Expand Forum to Full Width