Jump to content

Having problems with selectbox entry


inbowns

Recommended Posts

I have a select box and I would like to  select data click on it and I guess it should reload the page and populate the text boxes i have below with the data from the database. Below is the code so you can have an idea what i'm trying to do. Is this possible and help would be greatly appreciate.

 

Thanks in advance.

 

<html>
<head>
<meta name="generator" content="PhpED Version 5.9.5 (Build 5989)">
<title> RSVP Administrator</title>
<link rel="shortcut icon"  href="">
</head>
<body>
<fieldset>
<legend>Events</legend>
<table>
      <tr>
      <td>
         Select an address:
      </td>
      <td>
        <SELECT NAME>
         <option value=' '> <? echo $option1 ?>;</option> 
         </SELECT>
      </td>
   </tr>


   <tr>
      <td>
        Place of Event:
      </td>
      <td>
         <input type="text" name="location" value="<?php if($option1 == " "){ echo " ";} else{ echo $address_1;} ?>">
      </td>
   </tr>
   <tr>
      <td>
          Address 1:
      </td>
      <td>
         <input type="text" name="address_1">
      </td>
   </tr>
   <tr>
      <td>
          Address 2:
      </td>
      <td>
         <input type="text" name="address_2">
      </td>
   </tr>
   <tr>
      <td>
         City:
      </td>
      <td>
         <input type="text" name="city">
      </td>
   </tr>
   <tr>
      <td>
         State:
      </td>
      <td>
         <input type="text" name="state">
      </td>
   </tr>
   <tr>
      <td>
        Zip Code:
      </td>
      <td>
         <input type="text" name="zip_code">
      </td>
   </tr>
   <tr>
      <td>
        Telephone:
      </td>
      <td>
         <input type="text" name="phone">
      </td>
   </tr>
     
   
</table>
  </fieldset>

</body>
</html>

 

 

Link to comment
Share on other sites

Put this in your SELECT tag:

 

<SELECT NAME="" onChange="this.form.submit()">

 

Then receive the values with $_POST at the top of the page.  Or I may not understand your question?

 

Something like what you wrote only I need the textboxes to fill in but on on submit when i select something from the select box i would like of the page to refresh and populate the textboxes.

Link to comment
Share on other sites

? If you use the [onChange=this.form.submit()] and add the $_POST's to receive the select values, the page will refresh and the text fields will be populated with the matching database values.  This isn't what you want?

 

Sorry but this is not working I'm I missing something?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.