how to fix an onclick problem in a tab content

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simon2x1
    New Member
    • Dec 2008
    • 123

    how to fix an onclick problem in a tab content

    The problem is this my submit button did not send to this $_POST['submit'] in my php code whether it because of the false in my button which i just add(<input type="submit" name="submit" value="Submit" onClick="show_c ontent('div_2') ; return false;"/>)how can i fix this thanks

    Code:
    <html>
    <head>
    <title>home</title>
    </head>
    <link href="SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="active_content.js"></script>
    <body>
    <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab" tabindex="0">Tab1</li>
        <li class="TabbedPanelsTab" tabindex="0">Tab2</li>
        </ul>
    
        <div class="TabbedPanelsContentGroup">
    
        <div class="TabbedPanelsContent" id="div_1">
        //this is where the content of the tab1 will be and i have another form in this content too
    
        </div>
    
        <div class="TabbedPanelsContent" id="div_2">
        //this is where the content of the tab2 will be
        <form action="home.php" method="post">
        <?php
        if (isset($_POST['submit'])) {
        if(empty($_POST['boded']){
        echo"Please do it again.";
        }else{
         $mgs = ($_POST['boded']);
         //then insert to my database   
        }
        ?>
        <form action="home.php" method="post">
    <textarea id="message" name="boded" rows="5" cols="40"></textarea>
    <input type="submit" name="submit" value="Submit" onClick="show_content('div_2'); return false;"/>
        </div>
    </body>
    </html>
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    If that's what you want, get rid of the return false.

    Note that the code that you've posted is invalid with nested forms and no closing form tags. Please validate.

    Comment

    Working...