Jump to content

populate hidden field from PHP database


dfalkowitz

Recommended Posts

Is there a way to call a PHP database within a *.html page and populate the answer to a hidden field?  For example: SQL DB has 2 fields ID and SEGMENT,

ID SEGMENT

1 A

2 B

3 C

4 D

 

I have a form:

        <form action="Untitled-2.php" method="post" name="form1" id="form">

                <input type="radio" name="ID" value="4" />

                4</label>

            <label>

                <input type="radio" name="ID" value="3" />

                3</label>

            <label>

                <input type="radio" name="ID" value="2" />

                2</label>

            <label>

                <input type="radio" name="ID" value="1" />

                1</label>

 

<input name="segment" id="segment" type="hidden" />

 

I want to be able to have a button onclick() go out the the php server collect which Segment it is and populate the hidden text field "segment" then submit all on the same HTML page?

 

 

Link to comment
https://forums.phpfreaks.com/topic/242885-populate-hidden-field-from-php-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.