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




Create Radio Button Group WHERE Other Fields Can Disappear?


I'm trying to create radio buttons on my form where if one radio button is selected, then other fields disappear. Here is classic example:

Do you have a passport?

o NO

o YES, if so Date issued: [date pull down menu]


See what i mean? If the user clicks NO, then the "yes" selection as well as the Date pull down menu will turn grey so that the user cannot select it anymore.
Is it possible doing this without reloading the page?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Radio Button Group Value Caption
I have 2 radio buttons in a group named Gender one being male and one being female, now how would i get the value from the user's choice out of the two radio buttons and assign it to an $Gender variable..?

Mapping Radio Button Set To Multiple Fields
I've been staring at a form for about a day now and hope a fresh set of eyes can shed some light on it. It has a couple of issues, but here's the first:

I'm trying to map a set of four radio buttons to eight fields in a MySQL database.  If you select Radio Option 1, for example, that value should be passed into SQLField1, the now() value passed into SQLField2, and SQLField3 through SQLField8 would be passed no value. Code:

Passing Radio Button Values To A Submit Button (gif)
How do i pass the value of the radio button to be put of the action
that includes the value as part of the URL being submitted - "/
picked.php?pick_num=". Any help with be appreciated. Thanks

<form method="post" action="/picked.php?pick_num=".<php? $value ?
<input type="hidden" name="cmd" value="0">

<table width="100%">
<td align="center">
<INPUT TYPE='RADIO' NAME='pick_1' VALUE=&#391;'>Day;
<INPUT TYPE='RADIO' NAME='pick_2' VALUE=&#392;'>Week;
</td>
</tr>
<tr>
<td align="center"><input type="img src="/images/pick_now.gif"
BORDER="0" name="send"></td>
</tr>
</table>

Radio Button
What i want to do , is when someone click a radio button , a text will load up at the bottom at the page , without the whole page be reloaded, i ave 0 idea how do it , just the readfile maybe...

Radio Button
I have a radio button:

<input type = "radio" name = "id" value = "">

The info that needs to be put into value field is $id.  I know that I can not put $id there.  If I put 7 there, it works with no problem.  I am getting the $id value from a database. Any ideas on how to handle this. 

Radio Button Problem
from one radio button on Cilck is it possible to get 3 values
as the attached image having folder jpg's but i want to use radio button in place of that so that i can use in my PHP file.

Passing Var For Radio Button
I passed as variable (temp) from one php page to a php preview page - radio buttons "hot" and "cold".

Now, I want to pass it back to the first page so the radio button can be checked when someone wants to go back to change it.

The plan is to check if it's page 2 value is "hot" or "cold".
If hot, echo an input line in the form going back to the first page. If cold do the same but with a diff name.

Then on the first page check if "hotchecked" is true. If true then php puts "checked" in the input of the radio button form making it checked as before the preview. If "coldchecked" the same would happen making cold button checked.

This code below crashes when I try to get the value for comparison...

-------------------------------------
<?php if ($HTTP_POST_VARS["temp"]=="hot") {
echo "<input type="hidden" name="hotchecked" value="sss">"; }?>

<?php if ($HTTP_POST_VARS["temp"]=="cold") {
echo "<input type="hidden" name="coldchecked" value="sss">"; }?>
---------------------------------------

Radio Button Output
i have a little form with some radio buttons rate 1 to 5 kinda thing. my script mails me when submitted but it is blank even though i selected the buttons. i have done this with regular text fields with no problem but i think the out of the radio buttons needs to be different Code:

Radio Button Selected
What I wish to do is have a radio button pre-selected depending on what is pulled from the database.

For example if I had 2 radio buttons:

o Yes o No

One has the value 1 and the other has the value 0

If 1 is selected from the database then Yes is pre-selected, else 0 is pre-selected. How would I do this?

Validate Button Radio In Form
I use php and javascript on a form.
My validate script doesn't work with radio button. What's wrong? I
want to be sure that one of the button is press. M or F

I get on my first page:

How Do I Display Radio Button Results?
I have a form which uses several radio buttons to enter data. It works fine
as far as entering goes, but I can't figure out how to display which button
is checked when I view the record. I could do a if-then routine but it
seems like there should be an easier way.

Setting Radio Button State
I am trying to set the state of a radio button. I do not see what I am
doing wrong. Sorry, I am new at this.. I need another set of eyes to
look at this snip of code. I am trying to set the radio button with this
link of code:

echo 'SCRIPT language=JavaScript
setCheckedValue("'.$_SESSION['abbr_letter'].'");</SCRIPT>' //?

<snip of code>

<?php
session_start();
if(!isset($_SESSION['abbr_letter'])) {
$_SESSION['abbr_letter'] = 'A'
}
require_once 'includes/config.inc.php'
require_once 'includes/header.inc.php'

if (xdebug_is_enabled())
echo "enable";
else
xdebug_enable();

//
// Start a Form
?>
<HTML>
<HEAD>
<link href="quotesCss.css" rel="stylesheet" type="text/css">
<SCRIPT TYPE="text/javascript">
<!--
// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
function setCheckedValue(newValue) {
var len = document.author_abbrv.abbr_letter.length
for(var i = 0; i < len; i++)
{
document.author_abbrv.abbr_letter[i].checked = false;
if(document.author_abbrv.abbr_letter[i].value ==
newValue.toString())
{
document.author_abbrv.abbr_letter[i].checked = true;
}
}
}
-->

Radio Button/Checkbox Value Passing
I have a simple 3 page registration form. One form, one "data
validation" script and one "insert into database" script. The customer
bounces back and forth from the form to the verification script until
the data is all correct. (When I say bounces, I mean logically. All the
customer ever sees is the registration form, plus or minus error
messages.)

The problem I am having, is that if verification fails, the customer is
redirected to the form. I am able to pass the input values from the
"data validation" script back to the registration form using this
method:
<input id="Name" name="Name" type="text" value="<?php echo $Name ?>>

It works well, but I don't know how to pass the variable of a radio
button or check box back. I remember in javascript and other similar
languages you could do something like:
checkbox.value=checked

Is there a way to do this in PHP? What I am attempting to do, is make
is so that if the customer chooses YES on a radio button and the form
is submitted,; ifthey are sent back to the form to correct an error,
the radio button YES is still checked. I am not just trying to pass the
variable, but to also make it select the right option when it goes
back.

(Or is this just more of an HTML question, at which point I will ask
elsewhere)

Radio Button Not Showing Preselected In FF
I havea a PHP form that is working as expected, when there is an error the user is prompted to fix it before they can move on. I have a series of radio buttons generated from an array. I use a quick if check to see if the array value matches the post value so the radio button can be turned on or not.

In the rendered HTML you can see the value "checked" in the radio button field, and the radio button displays checked in IE, but not in FF. Any thoughts? PHP Code:

Multiple Radio Button Groups - Please Help! :)
I'm having a problem with multiple radio button groups within a while
loop. I have the page made so it pulls from a database the row values
- one of which is a Y or N value. I have a radio button group for the
Y and N value for each row of the database that gets pulled but only
the last row will populate the value retrieved from the db. I know
that I have to create a unique name for the radio buttons for each row

Radio Button To Post Variable ?
how do i post the below code of a radio button as the name is a variable called $button_name?

<td align="center"><input type="radio" name='.$button_name.'  value = '.$orderId.'  unchecked> Selected</td>

The line below doesnt seem to be takin the value to the other page, iv tried " " around the variable but dont work? Code:

Radio Button Values Won't Post To SQL DB
I have a form with radio buttons. I typically don't use them and thought I would take the time to figure them out this time. The values won't post to the database. Please let me know what I'm doing wrong here. The joint field is a yes/no question with 2 radio buttons: Code:

Default Selection Radio Button
I have a table where users input a date, time, and quantity for a reservation.  On my page ... because I have a junk calendar and coding, every time you click a different month on the calendar or click the "book now" button without entering all the necessary data, the page refreshes and erases all the data. 

One significant problem is that the times display as radio buttons. Some tours have one time and some have multiple times. On the page, if there is only one time, then to make it easier for users to book tours, I inputted CHECKED into the html code. But unfortunately if the tour has multiple times, then CHECKED doesn't work for the first radio button, it defaults the last radio button because of the php loop. Code:

Passing Radio Button Form Data
I am running php as a sapi module on winXP with Apache. I am passing the data from a radio button from one page to another to be processed. For some reason it seems to be passing no data - for example in the 1st page I would have 3 radio buttons in a loop:
<input type='radio' name='radio' value="<?php echo $val ?>">

I would then attempt to read the data in page 2 : <?php echo $radio ?> but this comes up empty. I tried using "get" in my form, and although the name/value pair appears in the URL string, it does not pass itself to the $radio variable in the next page. What the??? Does anyone know of any reason why php would NOT allow a radio button (or any other form object) it's data to pass on. I am not using sessions.

Radio Button - Reading Pre Selected Values From Db
I am able to make a selection of information when entering a record, with
radio buttons giving the option of yes, or no.

Which stores their answer as yes, or no in the database. I then have an
update record page that reads information in the database, and presently it
will not retrieve the previously selected option from the database. I have
tried all sorts of if else statements, and can't get anything to work. I
want the previously selected option to be selected when they are entering
the update page. Thus, they have the option to change it, but want their
previous setting selected so they are aware of their currently selected
option is.

<td width="50%"> <input type="radio" name="ud_digdocs" value="Yes">Yes
<input type="radio" name="ud_digdocs" value="No" checked>No

POST Values Of Radio Button And Checkboxes
i am looking to get the values of my radio buttons and checkboxes and have the values added to my $msg variable and sent in an e-mail.  this is my code:

PHP Conditional Setting Of Radio Button Default
I'm working on an edit inventory form, and I'm pulling a field from my database that's going to be a 'Y' or 'N'.  Based upon this, I want to default the 'customizable' radio button to either checked="Y" or checked="N". Code:

How To Perform IF Stement Depending On Value Of Form Radio Button
I have a form with a radio button and depending on the value of it's 'yes' or 'no' I want to perform 2 differnet SQL queries. Code:

Processing Radio Boxes And Hidden Form Fields At The Same Time
I have a form that needs to be checked. It contains 4 radio boxes a submit button and 4 different hidden fields. How do I get my php script to check if a radio box has been selected and tell the user to check a radio box if he hasn't?

The script I am currently using doesn't work; if the user chacks some thing then it proceeds as usual, but if it is left blank then the program freezes up and nothing is displayed apart from the stuff outside the <?php?> tags.

Select From Radio Button + Enter Username = Open User Profile
I have 4 radio buttons. each button to determine which page to go to. But
before page open user enters username in a text box. So when submitted, Page
opens relevant to that user displaying selected page.

Page 1: <radio button> >>>>>>>>>> this page to go to page1.php (this is a
table of user records 1)
Page 2: <radio button> >>>>>>>>>> this page to go to page2.php (this is a
table of user records 2)
Page 3 :<radio button> >>>>>>>>>> this page to go to page3.php (this is a
table of user records) 3
Page 4: <radio button> >>>>>>>>>> this page to go to page4.php (this is a
table of user records 4)

Enter Username: [text box] >>>>>>>> any user with their username

[submit]

Result should be :

If User FAB5 selects radio button 1 >>>>>>>>>. to display FAB5's page1.php

How To Create List Of People With Yes/No Radio Buttons For Each, Then Process Form
I have a database result set with names, IDfield and a Y/N field.

How do I create the radio buttons that can then be processed easily using an
array (I assume) with an easy-to-loop-through structure?

The form would look like:

Joe Smith O[Y] O[N]
Karen Smith O[Y] O[N]
....

Create A Print Button?
I would like to create a print button for my web, the purpose is, when the user click the print button, it will show the print dialog. Anyone know how to create this?

Create Array From 2 Database Fields
I want to create an array of product prices, with the product id as the index and the product price as the value, so i can place the prices for particular products wherever i want on my page.

Both product id and price are taken from the Products table
SELECT prod_id, prod_price FROM Products

Due to the client wanting an unusual layout, I cant just loop a table with the data, I need to be able to print $Price[2]; (for product id 2) wherever I like, for example.

Best Way To Create Object From A Form With Lots Of Fields
I have multiple forms that will create an object. Basically a energy
efficiency measure object. The measure object will have a couple of
required properties set but after that it can have 10-20 different fields
that are optional per measure.

How do I account for the different fields that will be
posted from the different forms when I create the measure object? Should
I create a constructor method with just the required fields as the
parameters and then create some sort of setter method for the optional
fields? Or do I create a different concrete measure object from an an
abstract measure base class? I have about 10 different measure objects
that I can think of but really the only difference between them are what
optional fields are posted.

Going forward the other issue is I need these measures to persist across
the pages of the application (sort of like a shopping cart app) and I see
that I can serialize an object in a $_SESSION object but do the fields
that I would set in the setter method also get serialized or do only the
actual properties of the object get set.

I then need to retrieve all these measure objects and send them to a
stored procedure to enter into a database so unfortunately I can't save
the fields as serialized because each field has to be separate to be sent
as the parameters to the stored procedure.

Basically my question is how do people deal with huge forms and fields
easily from a html post?

How To Alter Script So Button Will Go To URL Not To Create Account
I have a "create account" button on my site which I would like to change the properties so it goes to a particular URL when clicked and not to the create account form. I think the following is the script I need to alter, but I could be way off the mark as I am very new to php.

tpl_login_default.php

<?php echo zen_draw_form('create', zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')); ?>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CREATE_ACCOUNT, BUTTON_CREATE_ACCOUNT_ALT); ?></div>
</form>

PHP Script To Sort Data/create Pages According To Fields?
Someone fills out 3 fields. (There will be more but this is just to
give you an idea)

1. Country
2. State
3. City

I want this script to generate a web page and list the people by
information submitted.

eg. Everyone that put in USA will be listed on a page.

or

Choose California and everyone that typed in California will be listed
on a page.

I can also create links with criteria at the end. eg.
mysite/search.php?=montana

This script will also accept data from people. So people will visit,
type of the form and if the information is valid (not spam) then
they'll be in a database and able to be sorted.

Looking For A PHP Script To Sort Data/create Pages According To Fields.
eg.

Someone fills out 3 fields. (There will be more but this is just to
give you an idea)

1. Country?
2. State?
3. City

I want this script to generate a web page and list the people by
information submitted.

eg. Everyone that put in USA will be listed on a page.

or

Choose California and everyone that typed in California will be listed
on a page.

I could also create a link with the search term at the end. eg.
mysite/phpsearch=?montana

This script will also accept data from people. So people will visit,
type on the form and if the information is valid (not spam) then
they'll be in a database and able to be sorted.

Create A Button To Export A Mysql Table To An Excel File.
Does anyone have the code that creates a link, and on click, takes a specified table in my database and exports and downloads an excel file?

Php Value Disappear After The First Space ?
why is the value of a php variable disappear after the first space ? i was coding :-

echo "<a href=javascript:goto('$a[0]',$a[1]')>$a[1]</a>

but if the value of $a[0] is 'T h i s' then when my mouse is over the anchor,the value is :- javascript:goto('T this is a syntax error !

Session Variables Disappear When Popup Window Closes
I am in window one (of one) and I popup a second window. Everything is fine.  When the popup window closes the entire session in window one is destroyed!! I have tried everything from named sessions to caches, etc.. This does not happen when i start out with two windows open??

Upload File Having Browse Button And Submit Button On Same Form
I am building a form where the user must upload a picture and fill in his
details.
Now I have a problem as all of this is on the same form.

How will I be able to have the Browse button to open the "file browse"
dialog
and the Submit button to submit the form data.

As I believe you can not use GET but must use POST method for form.
Is there any means that I can use GET cause I need to get form variables
from URL as well.

Image Button Vs. HTML Button
I have a form I've been working on trying to get working, and to my surprise, the only reason it wasn't working was because the submit button was an image. PHP Code:

GROUP BY...
I've a little problem with GROUP BY for my query:

SELECT
`rel_experience_client`.`client_ref`,
`client`.`id`,
`rel_experience_client`.`experience_ref`,
`experience`.`id` AS `id1`,
`experience`.`titre_fr`,
`client`.`libelle`
FROM
`rel_experience_client`
INNER JOIN `client` `client1` ON (`rel_experience_client`.`client_ref` =
`client1`.`id`)
INNER JOIN `experience` ON (`rel_experience_client`.`experience_ref` =
`experience`.`id`)
RIGHT OUTER JOIN `client` ON (`rel_experience_client`.`client_ref` =
`client`.`id`)
ORDER BY
`client`.`libelle`

[XML] Is There An XML Group?
I've typed an XML source which calls a CSS source, the result should be
a page displayed in IE6,
instead I see the XML source.
That's pretty logical since there a no XHTML tags for IE6 to interpret.

I'm looking for a discussion group like'comp.lang.xml' but I can't find
one.

Group By Problem
I am trying to use group by but whenever I run the page only 3 rows are displayed, 1 of each type.

This is my code:

$result = mysql_query("SELECT * FROM programs group by type order by name desc", $link) or die ("query 1: " . mysql_error());

Add A Group On Server
I have a php page which calls an exe through exec function. This exe add a group on the server. The problem is that I don't have the permissions to create a new group (Control Panel/ Administrative Tools/ Computer Management/...) even if I change the settings of Security for the user aimed. So, the execution failed and the server returns me "Error 5".

PHP MySQL, Group By
I'm building an XML news feed search engine, using PHP and MySQL, and I am basing the style on Google.

I have achieved almost everything I have set out to do but... I would now like to incorporate the feature Google has were it shows 2 results from a website, and one is indented, and there's an additional link "More results from XYZ.com".

I've been fiddling around with GROUP BY, but, I would like to limit the group size to 2. Just like Google.

GROUP BY On A DATETIME
Is there an MySQL query to group data on year-month using datetime(YYYY-MM-DD HH:MM:SS)?

Mysql Group?
I'm having trouble coming up with what I would assume is a rather simple
mysql query about retrieving records that haven't been updated after a
certain time.

Group An Array
i have the following array:

Array
(
[0] =Array
(
[0] =Leamore Windows Ltd
[1] =553398833511417
[2] =20
)

[1] =Array
(
[0] =HRPC
[1] =920589205210538
[2] =1
)

[2] =Array
(
[0] =Leamore Windows Ltd
[1] =553398833511417
[2] =2
)

)

is it possible to group the items in the array and order by name to
output the following:

Array
(
[0] =Array
(
[0] =HRPC
[1] =920589205210538

[2] =1
)

[1] =Array
(
[0] =Leamore Windows Ltd

[1] =553398833511417
[2] =22
)

)

MySQLi Group
I have started a new group for those of us here that may run into
issues specifically with MySQLi in PHP5.

Group By Date
so i got some data on a mysql table that i want to group by date i was thinking of

SELECT song_name,DATE_FORMAT(date, '%m - %d - %y') as dates FROM tra_artist_song GROUP  BY DATE

how do make every data under the same date appear under that date

Group Script
Is there a php script that is similar to Yahoo Groups/ MSN Groups that I can download? I don't want to use Yahoo Groups cause it has ADs and not much customization. I want to put it on my website and customize it myself.

GROUP BY Php Syntax Needed
I'm having trouble figuring out the PHP syntax to display GROUP BY results.

Here's my MySQL query:


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