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:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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:
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=Ƈ'>Day; <INPUT TYPE='RADIO' NAME='pick_2' VALUE=ƈ'>Week; </td> </tr> <tr> <td align="center"><input type="img src="/images/pick_now.gif" BORDER="0" name="send"></td> </tr> </table>
Default Selection From Query
I'm having difficulty trying to have a DEFAULT selected record from a query in my dropdown box (code below). I have about 20 records in a 'facility' table, which listed names of our company's locations. I want to default select one of those records "exton" to be selected in my dropdown box. Code:
$_POST And Selection, Checkboxes, Radio Buttons On Forms
I'm creating a web form that has a number of radio boxes and drop down selection boxes and I can't get the $_POST global variable to hold the value if the person makes a mistake and has to go back and make corrections! It will work for normal text boxes and text areas but not the above! below is a snipit of my code PHP Code:
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:
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..?
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
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:
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?
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
Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10. I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???
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:
Selection
I am making a log generator and I have a minor issue with this script PHP Code:
Selection Box Via Selection
Basically I have a selection box which gets it's values from a database once this is selected the selection box's below will get the correct value from the above selection box which again comes from the database. The first selection box works by refreshing the current page and adding a variable to the file for example instead of useraddnew.php it would be useraddnew.php?maintcat=5 but the number 5 only gets set the second time you choose from the top selection I hope some one can help sorry if I explained it poorly. Code:
Date Selection
I have some records in my table that I need to extract if they are equal or greated than the current date. The date fields are in format YYYY-MM-DD. Could someone please provide some details on how to do this in php, I think I have a rough idea. Set date variable to current date, select all records from database where database date is >= current date.
Selection Of Ajax Lib ?
I m working on an PHP based site where in UI I need to use ajax funtionalities ... I just want some opinion from experts that which LIB is best for usage. I was wondering that using XMLHTTP is sometimes a bottleneck for cross browsers application. Different libraries are here but not sure which one to select.
Database Selection
I created two web database applications - first one is the company news system (as part of the company pages), second one is the company data presentation system (part of the company pages, too). All (unfortunately) the M$ environment - NT or 2003 server. The first app is managed from the web interface, the second app is managed by database client win32 app (created by PowerBuilder, std client-server approach, ODBC). For the second app I need to create the web presentation interface now (no data modifications, heavy sql queries :-( ). The first app contains only small amount of data (10 database tables, max 100 rows in the largest table) but the second app contains large number of tables, more than 100000 rows in major part of tables, very sensitive company data, requires sophisticated and intelligent db engine strategies for queries, ... For the first app I wanted to use MySQL, for the second one I wanted the Sybase SQL Anywhere. But now I am in doubt. I'm playing with the idea to substitute the Sybase SQL Anywhere by the PostgreSQL or MySQL. I need all the SQL decorations (stored procedures, stored functions, triggers, declarative referential integrity (foreign keys), ...) I'm playing with the idea to unify the database environment (use only one db engine and two databases, not two different db engines for two databases), too. Is the MySQL or (preferably-IMHO) PostgreSQL database engine stable, robust, safe, ..... in order to use it for these company very sensitive data, for heavy data mining app, ... ? Is it safe to unify the database engine types and use only one engine for these two apps/dbs? Can I rely on the MySQL and/or PostgreSQL engines? Do you suggest me to use (one of/both) these two db engines for the main company data presentation database?
Multiple Selection
I have a form that grabs reords from a mySQL database and presents the information in a nice pulldown menu. The client now wants that little menu to be a list that you can select multiple resords from (this is a brochure request for - the list has a max of 12 pieces). I know how to get the form to look the way I want, but when I parse the form with the little app I wrote in PHP that varifies the data entered, checks feilds, and then enters it in a mySQL database for tracking purposes - there is only one record in the database - even though there were more that one records selected. Now I am simply entering $properties (the variable of the menu feild) in the the INSERT statement of my database query - do I need to parse the records selected first - what am I doing wrong...?
Seperate Selection
I am trying to select data stored in a database as u can see and it gets dispalyed. But my problem is I need to beable to select each item individually instead of all at once or 1 item only. I need to beable to select say bread as an item and milk as an item but at the moment I can only select 1 or all items. PHP Code:
Selection From A List Box.
php and have to implement this functionality to select a user from a list box. I have written the code for this, but the problem is after selecting a name and doing the required task, it again selects the first entry in the list box. So if there are 100 users, the 100th one has to scroll down again and again. I need to modify this code so that until the session expires, if a person has selected his name once, that name will be selected in the listbox until he changes it. <select name="name" style="width: 120px;"> <?php $query = sprintf("select * from person order by person_name"); $result = mysql_query($query); $i = 0; while($row = mysql_fetch_array($result)) { $i++; printf("<option value="$row[person_num]">$row[person_name]</option>"); } ?> </select>
Form Selection
I am working on a form right now that when you click a radio button at the top it will select a few of the other radio buttons. Here is the code that i have. I just dont know how to do this. I have never done this type of form before. Code:
Listbox And Its Selection
im trying to create a webpage using mysql and php. im using the below code to populate a listbox with playernames held in my database. once i select a name; im trying to make the page gather the relevant information from that users details to be displayed on the same page. for example if i select "MoFish" from the listbox, i want it to echo all MoFish's details in the page such as his: "age" "height" "weight" if i select "Berty" i want it to echo bertys details. how can i acheive this? Code:
Random Selection
i want to randomly select 5 different values from a database, from one table, and then just assign those values to some php variable.
Option Selection
I am making a Option Box (Drop down bar) for Gender, (Male,Female) and I want when they Select there Gener, and then hit submit, it Writes to to a Database. i have it set it up so far that it goes to another page to INSERT it into the Databse.
GD Default DPI
I'm currently making a website that needs to edit images with adding text, the problem is, the picture starts at 300 DPI (pixels/inch), but after GD edits the image, it's set to 72 which i read to be the default value GD always uses. is there a way to edit that default to a higher number, if not are there other ways to edit images through php and still keeping the original DPI.
Dynamic Variable Selection...
Is it possible to create a bunch of variables in a loop with different #'s at the end of their name... like: while ($counter <= 10) { $myvar$counter; } to create 10 variables.... mayvar1, mayvar2, mayvar3, etc..... is there a way to do that?
Getting Multiple Selection Into One String
I have a listbox with 5 options. I have set it up to be able to choise more than one option. What I need to know is how to get all the selection into the one string that is stored in the DB It is easy to get the first selected option to post into the DB.
Random Selection Of CSV's
Is there a function in PHP-MySQL to randomly select comma-seperated variables in a text field? For example if you have a text field containing the values "1,1.2,4,5.6," is there a way of randomly selecting one of the numbers?
Multiple Selection Form
I have made a multiple selection form, but when I select more than one option, it still only returns one. PHP Code:
Random Selection Of String Value
Please tell me how I can randomly select a string from a limited set of string, and then use it in links. With equal probability, suppose half the time I want to form a link to domain.com/1234/page.htm and half the time I want to link to domain.com/5678/page.htm . I would like to be able to put something into my link such as: domain.com/<?php ... WHAT GOES HERE? ... ?>/page.htm If possible, I'd like to use a method that will put either 1234 or 5678 into a variable, so that, once it's randomly chosen for a document sent to the browser, then numerous references to that same string value can be used on the page.
Multiple Selection Lists?
i have a mutliple selection list on a form that goes like this <select name='name' multiple size=6>"; echo "<option value='one'>one"; echo "<option value='two'>two"; echo "<option value='three'>three"; etc it works fine. BUT how do u call it. For example say i selected option one and three. How do i call that on the next page so that ONE and THREE are stored.
|