|
-
February 18th, 2012, 05:20 AM
#1
buttons are going off
I am having one button1, when click on it another button2 comes. when click on button2 i am showing an image on the right side. But the button2 is disappearing. I want all the buttons to be present in the page. Please help whats going wrong in this.
Code:
<form method="post" action="">
<input type="submit" name="submit_base" value="Style">
</form>
<?php
if(isset($_POST['submit_base']))
{ ?>
<form method="post" action="">
<input type="submit" name="submit1" value="Style1">
</form>
<?php
}
?>
<?php
if(isset($_POST['submit1']))
{
$imagepath = "shirt7.jpg";
echo "<img style='float:right;' src='$imagepath' />";
?>
}
?>
The image is coming but style1 button is going off (disappearing). How can I retain the buttons.
-
February 18th, 2012, 10:20 AM
#2
Re: buttons are going off
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
February 18th, 2012, 10:29 AM
#3
Re: buttons are going off
 Originally Posted by sujan.dasmahapatra
The image is coming but style1 button is going off (disappearing). How can I retain the buttons.
Last time I'm going to tell you this...Stop using forms for these implementations!
Forms are for sending data to the server. So...if you're using forms, your page is going to be reloading whenever you submit it...Therefore all your HTML/JavaScript data will be lost on the page.
I'm not going to continue to do your work for you. You've ignored all my advice the previous 4 times. If you ignore it again instead of trying to learn from it, I will not reply in any future thread.
Last help:
- Go and read/learn thoroughly from W3School's JavaScript tutorial. You NEED it.
- To hide/show HTML DOM elements, you need to change the CSS style. To hide, use display: none in CSS and obj.style.display = "none"; for JavaScript. To show it, use obj.style.display = ""; for JavaScript.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|