CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2007
    Location
    Bangalore,India
    Posts
    154

    Unhappy 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.

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+)
    Join Date
    May 2002
    Posts
    10,798

    Re: buttons are going off

    [ moved thread ]
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+) PeejAvery has a reputation beyond repute (3000+)
    Join Date
    May 2002
    Posts
    10,798

    Re: buttons are going off

    Quote Originally Posted by sujan.dasmahapatra View Post
    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.

+ Reply to Thread

Bookmarks

Posting Permissions

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



HTML5 Development Center

Click Here to Expand Forum to Full Width