Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8540099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:31:19+00:00 2026-06-11T11:31:19+00:00

I have written php code to retrieve data from database to div in webpage.i

  • 0

I have written php code to retrieve data from database to div in webpage.i have another form that has a submit button,when i click on that button that will do a function of retrieving the database values and that values will be displayed in a division. i have the following code in the division how to clear it using button.

this is php code that retrieves when the value is submitted from previous form

 <div id="result" style="margin-left:10px;">
<?php
    mysql_connect("localhost", "root") or die (mysql_error ());
    mysql_select_db("theaterdb") or die(mysql_error());
    $strSQL =("SELECT theater_name,address FROM theaters WHERE theater_name='" . mysql_real_escape_string($_POST['course']) . "'");
    $rs = mysql_query($strSQL);
    while($row = mysql_fetch_array($rs)) {
    echo "<b>Theater Name:</b><br>";
    echo $row['theater_name'] . "<br /><br /><br />";
    echo "<b>Theater Address:</b><br>";
    echo $row['address'] . "<br />";
     }
     mysql_close();
    ?>

i have the following HTML code for a button

<form method="post">
<input type="reset" value="reset" />
</form>

i am using this button.when i click this button it should clear the contents of division, how to do this..can anyone help me….

Thanks in advance….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:31:20+00:00Added an answer on June 11, 2026 at 11:31 am

    Reset button couldn’t clear the DIV content. You can do it using your form Submit Event. In plain javascript it should be something like this:

    <script>
    function clear_div() {
        document.getElementById("result").innerHTML = "";
    }
    </script>
    
    <div id="result"></div>
    <form method="POST" action="process.php" onsubmit="clear_div()">
    <input type="submit">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a PHP function to take a video embed code that has
I have written a code for taking JSON data from a PHP and putting
I have written a php code which will get one id from database and
I have written some code in PHP that returns the html content from .edu
I have written simple code to get content from xml file to php. $xml
I have written a simple code in page test_cookie.php to work with cookies. if(isset($_GET['data']))
To dynamically fill DropDown controls on my HTML Form, I have written code that
I have written a chunk of code that is aimed at reordering pages. <form
I have written some PHP code that will return a value if there are
I have written some JavaScript code that will read from the Google Maps API

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.