Results 1 to 2 of 2

Thread: hide content on page after form submit

  1. #1
    Join Date
    Dec 2012
    Thanked 0 Times in 0 Posts

    Default hide content on page after form submit

    I'm new to php, using dreamweaver. I hope someone can help me with this problem. I have a form on my tables.php that inserts values into a database using the insert behaviour from dreamweaver which works fine.

    i want to use the contents from one of the hidden input fields from that form to manipulate the look of another page called listing.php. Is this possible? Any help will be appreciated. Thanks in advance.

    Here's the code:

    PHP Code:
    <td width="160" class="amount"><form action="<?php echo $editFormAction?>" method="POST" name="shortTerm" id="shortTerm">
    <input name="short" type="hidden" id="short" value="<?php echo $_SESSION['MM_UserGroup']; ?>">
    <input name="term" type="hidden" id="term" value="50">
    <input type="submit" name="termButton" id="termButton" value="$50 USD">
    <input type="hidden" name="MM_insert" value="shortTerm">
    PHP Code:
    <?php if (isset ($_POST['term']) && $_POST["term"] == 50) { ?>
    <select name="type" id="type">
    <option value="Rent">Rent</option>
    <?php ?>
    Last edited by keyboard; 12-16-2012 at 10:45 PM. Reason: Format: Php Tags [php][/php]

  2. #2
    Join Date
    Mar 2011
    N 11 19' 0.0012 E 142 15' 0
    Thanked 100 Times in 98 Posts
    Blog Entries


    Your form's using the post method, so you can access the contents of form elements like this -
    PHP Code:
    So, assuming that tables.php submits to listing.php, you can echo the contents of the input "termButton" (an example) like this - (this code would go on listing.php)

    PHP Code:
    echo $_POST['termButton']; 
    Posting Tips + FAQ | Issues? Feel free to PM me
    - keyboard1333[at]gmail[dot]com

Similar Threads

  1. submit form data to same page
    By danielmeade in forum PHP
    Replies: 1
    Last Post: 02-15-2011, 10:08 PM
  2. Hide Show Div For submit form
    By why not in forum JavaScript
    Replies: 0
    Last Post: 11-10-2010, 11:13 AM
  3. Replies: 36
    Last Post: 05-04-2010, 01:46 AM
  4. show/hide div layer on form submit?
    By moscarda in forum JavaScript
    Replies: 7
    Last Post: 02-15-2008, 10:17 AM
  5. Form action Mailto need to open new page on submit and submit email
    By lstammer in forum Looking for such a script or service
    Replies: 0
    Last Post: 12-06-2007, 05:41 PM


Posting Permissions

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