473,509 Members | 6,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to fix an onclick problem in a tab content

123 New Member
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_content('div_2'); return false;"/>)how can i fix this thanks

Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <head>
  4. <title>home</title>
  5. </head>
  6. <link href="SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
  7. <script type="text/javascript" src="active_content.js"></script>
  8. <body>
  9. <ul class="TabbedPanelsTabGroup">
  10.     <li class="TabbedPanelsTab" tabindex="0">Tab1</li>
  11.     <li class="TabbedPanelsTab" tabindex="0">Tab2</li>
  12.     </ul>
  13.  
  14.     <div class="TabbedPanelsContentGroup">
  15.  
  16.     <div class="TabbedPanelsContent" id="div_1">
  17.     //this is where the content of the tab1 will be and i have another form in this content too
  18.  
  19.     </div>
  20.  
  21.     <div class="TabbedPanelsContent" id="div_2">
  22.     //this is where the content of the tab2 will be
  23.     <form action="home.php" method="post">
  24.     <?php
  25.     if (isset($_POST['submit'])) {
  26.     if(empty($_POST['boded']){
  27.     echo"Please do it again.";
  28.     }else{
  29.      $mgs = ($_POST['boded']);
  30.      //then insert to my database   
  31.     }
  32.     ?>
  33.     <form action="home.php" method="post">
  34. <textarea id="message" name="boded" rows="5" cols="40"></textarea>
  35. <input type="submit" name="submit" value="Submit" onClick="show_content('div_2'); return false;"/>
  36.     </div>
  37. </body>
  38. </html>
  39.  
Oct 31 '10 #1
1 2052
acoder
16,027 Recognized Expert Moderator MVP
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.
Nov 1 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1578
by: malcolm | last post by:
How do I get a web-browser loaded with on-the-fly content and a JavaScript onclick popup function to work? I've embedded an axWebBrowser in my (vb.net) application. The browser starts with...
14
2108
by: j1c | last post by:
How can I remove the content in between tags? I have a page that has several custom tags: <!--tag:1--> Content 1 <!--/tag:1--> <br> <!--tag:2--> Content 2 <!--/tag:2--> <br> <!--tag:3--> Content 3...
10
2624
by: clintonG | last post by:
Can somebody direct me to documents or source that supports the use of collapsible content that is collapsed by default when the page is loaded? The secondary objective would of course be...
3
3779
by: f1crazed | last post by:
Hello, I am wanting to fire the onClick event of button1 by pressing button2. Does anyone have a clue if this is even posible? If so PLEASE HELP!! Thanks.
3
5869
by: Byron | last post by:
Hi, Javascript confuses me, so I usually limit myself to Dreamweaver's built-in scripts for stuff like imageswaps. But this time I'm trying to write something very simple myself. I do most of my...
8
9512
by: cool2005 | last post by:
I tried to dynamically add/clone a <tr> from an existing <tr> to a <table> but the problem is that I need to have a "onclick" event handler in the <tr>. I have tried following A. approach...
6
4214
by: Duncan | last post by:
Does anybody know how the following can be acheived using html or xhtml? I need to present colleagues with a 'to-do' list. Lets say the list has ten or so jobs and each job consists of five or...
2
1946
by: stevemtno | last post by:
I've got a problem with a web page I'm working on. I have 4 modules - one of them has 2 tabs, two of them have 4 tabs. When the user clicks on the tabs, the content below them changes. However, when...
3
4404
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
1
4296
rahulephp
by: rahulephp | last post by:
CSS Tabs - contents of a div disappear in IE & onclick is not working Here is the code: Swaps the "active" tab and "inactive" tab and swaps out the new content via the display style attribute: ...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.