Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Php Checkbox And Textbox Combo


I have a form which asks:

How did you know about us?

--friend
--flyer, where_______
--web
--other, _______

I want to store in the db whether the user checked the box and on
certain questions, store the additional description, as indicated by
the _____

How do I go about in doing this? I need help getting the values to
perform an INSERT in the mysql table using php.




View Complete Forum Thread with Replies

Related Forum Messages:
Checkbox To Prevent Textbox Value From Being Saved
A series of text box values are to be saved into a file. Next to each text box is a check box. If this box is checked, it means that the value of the adjoinding textbox is not to be saved. By looping through the $_POST[] array, all the names and values of the text box, including the checked checkbox get saved.

View Replies !
Textbox
i have a textbox named x, i entered some value for eg: i'am a boy: when i print the textbox,it returns i' am a boy, i know the reason for ',but i don't want it.

View Replies !
Php Textbox
if you could make a simple textbox into a URL creation thing. i am really not sure how to say this but ill try. for example, if you have a url like this ==> http://yousite.com/blah/blah/ and you want to make an addition to taht url via textbox how would you do that?

View Replies !
Textbox Value
i have two textfields text1 and text2. i enter a value in text1 field suppose 2006-1-1 like that so the text2 will have to take the value X2006. Not beyond that. like text2 should not accept less than any value in the year 2006 no 2005 should not be taken. for example i enter value in text1 2000-01-01 date and text2 should accept any character in A-Zand 2000 ex:X2000.

View Replies !
Combo Box Value
On my site, if you click on a link i want you to be taken to a contact form that contains a combo box, but what I want to do is predefine what value of a possible five selections is set... What is the best way of doing this?

View Replies !
If And While Combo
I want to combine an IF statement with a WHILE condition.. They work fine seperate but i can't seem to combine them the way i want. Look @ my code so far: Code:

View Replies !
Combo Box?
how to make combo box link with my database? I want my data appear when drag down the combo box Can someone help me with the code i should use???

View Replies !
Combo Box
I am allowing users insert data into a database using a form. I want one of the fields "department" to display all existing departments in the database in a combo box for users to choose from and also have a field in the combo box for them to add a new department. Is there a way for me to do this in using php? I am using php to access the database.

View Replies !
Combo
I have a combo box :

<select name="stock" id="stock">
<option value="In Stock">In Stock</option>
<option value="Not in Stock">Not in Stock</option>
<option value="Discontinued">Discontinued</option>
</select>

I am connecting to the database and i want to display the results in a form and change the value of the combo box to the one value in the database for that record. How would i set the combo box to the correct value using php.

View Replies !
Combo Box With ALL
In a combo box, I have the user select a company name and that name is then sent to the query. What I am trying to do is if no selection is made, the query would still run as if all the selections were made, returning all the companies which fall into that category. Do you know how to do this? I created an <option>ALL</option>, but cant figure out what its value should be?

View Replies !
Combo Box And Sql
can any1 give an example of a query being called from a database in sql and the result being stored in a combo box in php?

The code for a normal combo box sending the value as item is show below but i want the options to be from specifically in the databse.

<select name="item">
<option>Paint</option>
<option>Brushes</option>
<option>Erasers</option>
<?php
$_POST['item'];
?>

View Replies !
Variable In Textbox?
This is the thing. My textbox:

<INPUT TYPE=text NAME=adresse SIZE=20 class=textbox>

I want the variable "$var" to appear in the textbox.

View Replies !
Textbox Formatting
say you've got this textbox that asks for a visitors first name. Is there a way to make the first letter of their name CAPITALIZED even if they typed it in lower-case? (i.e. they type "billyjoe" and I want the output to be "Billyjoe" with a capital B) I've been searching for a while, but haven't been able to come up with anything yet.

View Replies !
Getting A Value From A Textbox In The Same Php Form
My problem is that i want to get a value from a textbox in the same php form and pass it to another page. For example i have this:

<?php

echo "<td><input type="text" name="firstName"></td>";
$aname = $_GET('firstName');
echo "<td><input type="button" name="ClickMe" value="Click ME" style="font-size:7pt" onclick="window.addedit.location='newpage.php?&thename='$aname';"></td>";?>

so essentially i want to create a variable and assign the value in the textbox to it and pass it to a new page. I have tried $_GET, $_POST and $_REQUEST and all of them dont work.

I know you can do this really easily with .net or java, it would be just by saying something like $avar = textbox.value or something like that, but in php it seems a LOT more complicated .

View Replies !
Generated Textbox
I've got a web forum that has three buttons: next, forward, start. They serve as simple navigation through records of a mySQL database. I've also created a text box with php to display which record they are looking at: PHP Code:

<?
function textbox($the_name,$the_value)
{    
$_output = "<input type='text' name='".$the_name."' value='".$the_value."' maxlength=&#393;' size=&#394;'>
";
        return $_output;
}
//Generate dynamic textbox
        echo textbox('alpha',$number]);
?>

This works great for display the record but I thought, what if I could have the user enter in a record also to this text box. I've got html forms that do just that using POST method, but it would be nice if they could do it right at that textbox. Any ideas?

View Replies !
Storing The Value Of A Textbox
I have a form with a textbox and A submit button. I want the value of the textbox to be stored in a variable so as to pass through to other pages. I have reached this point:

page 1
<?php

session_start();

if (isset($_POST['txtusername']))
   $_SESSION['test'] = $_POST['txtusername'];
$_SESSION['test'] = 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

Im testing it both on localhost and web server. Unfortunately, the opening page is blank.

View Replies !
Textbox Is Empty
I am trying to test if the txt box txt_matrl from the previous page has anything in it. It always falls into the loop even if the text box is empty? I tried isset also. Can you see an obvious mistake?

if(($_POST['txt_matrl'])!= " ")
{
$mtrl = $_POST['txt_matrl'];
if ($strWhereSet == "Yes")
{
$strWHERE = $strWHERE." AND material like '".$mtrl."'";
}
else
{
$strWHERE = "Where material like '".$mtrl."'";
$strWhereSet = "Yes";
}

}

View Replies !
Display The Value Of Textbox
problem:

query="select from my table";
$result=mysql_query($query);
$rowc=mysql_fetch_array($result)
<select name="job" class="small">'
while($rowc=mysql_fetch_array($resultc))
{
echo '
<option value="'.$rowc[vacancy_id].'" selected>'.$row2[jobtitle].' </option>'
}
</select>
$sql="select * from mytable2 where vacancy_id=$_POST[job]"
$result2=mysql_query($sql);
$row2=mysql_fetch_array($result2);
<input type="text" name="contact" value="'.$rowc[contact_id].'">

i want to display the textbox without having POST or reloading the page. how would i pass the value of my dropdown into the textbox without reloading the page so that it will display the value of textbox.

View Replies !
Recordset To Textbox
i am trying to retrieve multiple fields from one recordset and post to a text field so that it is filled in automatically normally it is this:

<?php echo $row_rscidgendisplay['chalbysinitials']; ?>

but i would like to return multiple fields from the recordset and instert them into the text box

<?php echo $row_rscidgendisplay['chalbysinitials']; ['chalbysidd']; ?>

or similar Code:

View Replies !
Nl2br And Textbox
im using this linked to a textbox so that people can enter info and it will save to a database whilst when viewed outside of a textbox it will show normally in html. the problem is that if someone tries to edit there entry then it shows with ( <br /> ) on the end of the lines. this is kind of a problem because the people using my form wont have a clue what the hell is going on. is there a way to remove this from the textbox? second problem with it. if you then resubmit the info from the textbox then it duplicates the ( <br /> ) and causes there to be 2 trailing <br />'s on the end of each line.

View Replies !
If Yes, Checkbox Is Checked, If No, Checkbox
So I have this code that if one of the entries columns says 'yes' then the checkbox should be checked and if the column says 'no' then the checkbox should be unchecked. My code isn't working. Code:

View Replies !
Combo Box Values
I have values in a combo box where datas are coming
loaded dynamically. When an user selects a particular value and press search, even after refreshing the page, I want to keep the value same as the user selects. For example suppose if I selects
value PHP from combo box, after submitting the combo box should
value highlighted must be PHP. IS there any way I can do this?

View Replies !
PHP/MySQL Combo
How come sometimes I get the following error:

Fatal error: out of dynamic memory in yy_create_buffer() in Unknown on line 0

My code works most of the time, its a combination of PHP and mySQL, i have no function named "yy_create_buffer". And the worst problem with this error message, is that when that error comes up, its the ONLY thing that comes up.

Other error messages at least they show up inside my page and they say what I specify the error messages to say. This type of error message would look totally unprofessional on the site I'm developing and I'm curious is there anyway to prevent this or somehow pinpoint the cause.

I'm starting to lose faith in PHP/mySQL . I'm starting to doubt whether the PHP environment is effective for a search engine which searches what will be a relatively large database.

View Replies !
Selected Combo Box
i have the following code and i am having problems with setting the combox to select the value that is stored in the database. i am hoping that the combo box selects the value and the value from the database is stored in $title PHP Code:

<?php
function displayedit($id,$title,$fn,$ln,$instit,$depart,$email,$url,$room,$phone) {  
echo '
  <form name="editform" method="post" action="editform.php">

  <p class="body"><b>Title:</b>'

    $t ="Dr","Professor","Mr", "Ms"
    echo "<select name='selectTitle'>";
    foreach ($t as $value) {
     echo "<option value="$tvalue"";

View Replies !
Populating A Combo Box
Using php how can i give a combobox a default value when the page is loaded?

View Replies !
Make Combo Box
Suppose in the client side there is a table in which name of car manufacturer is given then if we click on it the different models of cars should come on he other list. give stepwise info.

View Replies !
$_POST & COMBO BOX
I just need the option chosen in another php file. i have the following peice of code in my index.php

<select id="papertype" name="papertype">
<option value= "0">Gloss</option>
<option value= "1">Gloss</option>
</select>

i need the chosen option in the details.php file (this doesn't work but here is what im using to try and call)

$desc= $_POST ['papertype'];

View Replies !
Combo Box To Submit
how do I use the combobox to submit the page to itself? I want to use the combobox to submit then when it opens itself again, the textfields below would be filled with data form the DB.

View Replies !
Need To Add A New Combo Box For States
Please want to add a new combo select box for states, once the country is selected, the states need to get populated in the states combo box.

Right now the current functionality is doing the following: when country is selected it is populating all the city names: I am attaching the files registration.php and registration_form.tpl.

View Replies !
Dynamic Combo Box
Iam working with a php, mysql program, In this program I have let's say 3 combo box (select tags) one for student_id , one for first name and the other for last name,

I already got data from mysql using( select * from student) and put them in these combos, but I need onchange of each one to execute another select statement (for example if we change first name select * from student where firstname=....), so I need to clear the other combos and refill them again according to the new query. so, I'll obtain all the students whose first name=...

here we need to call a function that makes combo clear using javascript (form1.fn.options.length=0) and also execute a new query(select * from student where fn=..) and refill combos again(new option(....))
my questions are:

1. do I need to call php function or javascript function onchange of select tag and if php how can i do that? 2.how can we take form variables (value of select) and put them in sql statement?

View Replies !
Combo Based
I need a solution to load data from db in combo based on the option selected in the previous combo for eg. have the list of countries(from db). should load the states(from db) based on the value we select in the country combo.

View Replies !
Combo Box Updating
I'm making a database input page for online gaming, and I'm having a little trouble. It's for a horse racing game, and I will be the only one doing the input. but I want to do the following: display only "player name" combo boxes. As the players are selected, I want to display the "horse name" and "driver name" combo boxes.

View Replies !
Load Text In A Textbox
Assume you see a textbox with name $textbox and you enter the following: yada yada, When you submit the linebreaks in the text will be converted: PHP Code:

View Replies !
Outputting Data From A Db Into A Textbox
how to output data stored in a database into a textbox. The idea is that i want to output user details into textboxes and allow them to be modified and then resaved if changes are made.

View Replies !
Multiline Textbox Problems
I'm having some trouble. On a page, I've got a multiline text
box. When I enter :

a
b
c
d

and hit submit (sending to my post.php page) and from post.php, echo
$_POST["info"] if shows up as a b c d. No carrige returns show. My
questions is... how can I do this? I know it's possible because I've
seen demonstrations, but can't seem to figure out how to do it.

View Replies !
Error Inside The Textbox Value
i want to display current date if the value is empty.

<input type="text" name="I_CreatedOn" class='textbox' readonly
value='if(empty($row[I_CreatedOn]))? echo $date_now;:echo $row[I_CreatedOn];'>

View Replies !
How To Get Value From A Dynamically Created Textbox
how to get value from a dynamically created textbox using php

View Replies !
Seach And Fill Textbox
can someone point me in the direction of script that will search a database and will offer a drop down that populates with the search results that can be selected to fill the textbox. 

View Replies !
Create Mask For Textbox?
I am creating a form in php and one of the fields will be prompting the user
to enter a time in the HH:MM format, is there anyway using php to create an
input mask so it appears as __:__

Or is there a better way to do this?

View Replies !
Php Insert Into A Textbox On Click
I have a textbox, where a user can write out a newsletter type deal.

I also have a list of products, that when the user click on it, it grabs all the info from the database and neatly generates html for the product.

I can deal with grabbing from the database and formatting, but i need some help with on click insert into the text box.

View Replies !
How To Insert Apostrophe To Textbox
how can i add an apostrophe (') or (") to my input box??

$title = "doom's dayl"
$txtTitle     = $form2->addElement('text', 'title', 'title', "value='$title'");

im using html_quickform here..

i only get "doom" in the textbox. when i try to add a "". i still get the same output.. what do you think i should do?

View Replies !
Textbox In A Form Is Filled
i used isset ... never worked...i did this :

if ($_POST["email"]&&$_POST["username"]&&$_POST["password"]&&$_POST["cpass"])...never worked

what do i do.

View Replies !
Auto Complete Textbox
I want an Auto-complete text box Where the values are coming from the database. Just as like G-mail's  "Mail to" text box.

View Replies !
Copy Dropdown Value To Textbox Value
Hi,
I have a form script with a dropdown box listing a lot of albums in this format:

"The Band - Name of the album"

there is another feild the users have to fill, it's a textbox where you have to write the band name. This is just making things harder for my members since the band name is already written in the album name, but filling the textbox is required for the process.

what i would like to do is the following:

When a user either click the submit button, or automaticaly when the dropdown box value is changed:
Automaticaly copy ONLY the text BEFORE the " - " from the dropdown to the textbox

Example:

If user select entry "abcdefg - hijklmnopqrstuvwxyz" from the dropdown, then:

Write "abcdefg" in the textbox

View Replies !
Posting Textbox Details
PHP Code:

<FORM method='POST' action='cert1pdf.php?id=$hello'>
<table bgcolor=#ffffff border=1><tr>
<td><strong>Quality Management</strong></td><td><strong>Yes</strong></td><td><strong>No</strong></td><td><strong>Notes</strong></td></tr>";
echo"<tr><td><strong>1 - Service Operations</strong></td></tr>";
$productsql1 = "SELECT * FROM survey WHERE rtid=1 ORDER BY id";
$productResults1 = mysql_query($productsql1);
while ($productRow1 = mysql_fetch_array ($productResults1)){
$ProductName1 = $productRow1["requirement_txt"];

View Replies !
Database Value Select In Combo Box!
This function is intended to display the current database field value as selected.. along with other values as general options.

I can't figure out how to get it work. Help is appreciated!!

function retrieve_category()
{
$cat = mysql_query("SELECT category_id FROM category");
while ($current_row = mysql_fetch_row($cat))
{
$row = $current_row[0];
if ($row == $id)
{
printf("<option selected>%s</option>
",$current_row[0]);
}
else
{
printf("<option>%s</option>
",$current_row[0]);
}
}
}

View Replies !
Combo Boxes Question
I am wondering how I can make the whole array appear in the code that is below with the database entry to be selected. At the moment it just displays the database entry.

View Replies !
Populating Two Combo Boxes
I have one combo box (Category) which is populated by a MySQL table using php. I am trying to use the onchange javascript to submit the value selected so that I can populate the other combo box (sub-category) based on what was previously choosen. So can anybody give me a clue on how to submit the first boxes value so that the second can see what was selected (javascript function).

View Replies !
Combo Box / Text Box Php Mysql
this is the the code, now here is the final result.... I get one combo box
<?php require_once('..library_databaseConnectionsonli nequote.php'); ?>
<?
function select_cases_price ()
{
$qy = "SELECT SellingPrice, Description FROM cases";
$rs = mysql_query ($qy) or die (mysql_error ());
while (mysql_fetch_array ($rs))
{ $select .= "<option value='{$r[0]}'>{$r[0]}</option>";
$prices[] = $r{1};
}
return array ($select, $prices);
}
?>

On your web page, call the function.

<? list ($select, $prices) = select_cases_price (); ?> And a bit of JS:
<script>
function showPrice() {
array prices (<? echo $prices ?>);
var i = document.form.item.selectedIndex; document.form.SellingPrice =
prices[i]; </script>

<select name="Description" onUpdate="showPrice()"> <? echo $select; ?>
</select> <input type="text" name="SellingPrice" value="">

View Replies !
Combo Box Value On Page Reload
I am new to php and mySQL so this is probably something very basic that I'm
missing. Basically, on the page I have 2 combo boxes but 1 of them is not
getting the value passed when the page is reloaded so the database can be
updated. I am echoing the field names passed and the field "theDriver" is
there but it's empty. I've include the code parts where I believe the
problem should be but I'm stumped and I've been trying to solve this for 2
days without success. Would someone mind examing the following code and
tell me what I've done wrong?

Following code constructs the combo box on the page from a MySQL table:
<?PHP
$table = "tblEmployees";
$Link = mysql_connect ($host, $user, $password);

$Query = "select concat(empID,' ',empFirstName,'
',empLastName)
as full_name from $table WHERE empTitle =
'Driver'";
$results = mysql_db_query($database, $Query, $Link);
?>

&nbsp;&nbsp;&nbsp;&nbsp;<b>Driver:</b>
<select name = "theDriver" size="1">
<Option Value=" ">Select One:</option>

<?PHP
for($u=0;$u<mysql_num_rows($results); $u++)
{
$driver=mysql_result($results,$u,'full_name');
?>
<option value="<?PHP echo($ID); ?>"><?
echo($driver); ?></option>
<?PHP
}
?> //end php

</select>

When Page is reloaded the following code is run but the combo box titled
"theDriver" is empty

foreach($_POST as $field => $value)
{
echo $field; //field names from form
echo "; ";
if ($field == "theDriver")
{
echo " - here's the driver for ya: ";
$$field = strip_tags(trim($value));
echo $$field;
$pos = strpos($driver, ";");
echo "<br> the ; is in pos $pos <br>";.......

View Replies !
Dynamic Combo Boxes
i have a problem with creating some dynamic combo boxes. i have a form and the user enters the number of printers required, on the recieving page i display that many combo boxes ready for their input...but the problem is its not generating the correct number of combo boxes for some reason. i think i'ts because i need to reset the cursor on the result set so it can whip through the printers again but am not sure. please see following code:

View Replies !
How To Validate A Html Combo Box
I have a combo box on my html page that i would like to validate through php processing.
the name of my combo box group is "location" how would i use an IF statement to validate the contents of this combo box?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved