473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

valeur par défaut

Ah et aussi pendant que j'y suis, un problème "facile",
juste par ce que je connais pas la syntaxe.

J'ai crée un formulaire de modification, dans lequel sont affichées les
valeurs déjà rentrées pour éventuellement être modifiées...

On y trouve des lignes du genre:

<td><input type=text name=lieu maxlength=100 value="<?echo $lieu?>"

tout va pour le mieux pour elles.

Mais pour ce qui est du compte en banque:

<td><select name="compte">
<option value="liquide" liquide
<option value="LaPosteCCP" La Poste CCP
<option value="CAcourant" CA courant
<option value="LaPoste-livret">LaPoste livret
<option value="CA-livret" CA livret
<option value="CA-PEL" CA-PEL
<option value="CA-CEL" CA-CEL

là, je ne sais pas comme faire comprendre à l'ordi que la valeur par défaut
doit être $compte
($lieu et $compte ont été postés d'une autre page php)
Bonne nuit
Mathieu
Jan 5 '07 #1
3 2230
Rik
Mathieu wrote:
Ah et aussi pendant que j'y suis, un problème "facile",
juste par ce que je connais pas la syntaxe.

J'ai crée un formulaire de modification, dans lequel sont affichées
les valeurs déjà rentrées pour éventuellement être modifiées...

On y trouve des lignes du genre:

<td><input type=text name=lieu maxlength=100 value="<?echo $lieu?>"

tout va pour le mieux pour elles.

Mais pour ce qui est du compte en banque:

<td><select name="compte">
<option value="liquide" liquide
<option value="LaPosteCCP" La Poste CCP
<option value="CAcourant" CA courant
<option value="LaPoste-livret">LaPoste livret
<option value="CA-livret" CA livret
<option value="CA-PEL" CA-PEL
<option value="CA-CEL" CA-CEL

là, je ne sais pas comme faire comprendre à l'ordi que la valeur par
défaut doit être $compte
($lieu et $compte ont été postés d'une autre page php)

Hmmz, I hope I understood this ...

As long as you know which option should be selected:
<option value="liquide" selected liquide

Or in XHTML:
<option value="liquide" selected="selected">liquide</selected>

If you have an array of possible values, you might:

$choices = array('option1','option2,'option3');
$default = 'option1';//or you might get the currently chosen value from a
database.

foreach($choices as $choice){
printf('<option%s>%s</option>',($default==$choice)? '
selected':'',$choice);
}
--
Rik Wasmus
Jan 5 '07 #2
Rik
Rik wrote:
><option value="liquide" selected="selected">liquide</selected>
Euhm, </optionoffcourse....
--
Rik Wasmus
Jan 5 '07 #3
ok thank you very much
Jan 5 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: pascal Joseph | last post by:
J'ai un formulaire avec un seul champ text appelé "unite" et un bouton. En javascript j'aimerai utiliser un script qui interdise les valeurs de type "char" et soit supérieur à 0 J'ai trouvé...
4
by: Patrick6 | last post by:
Hello everyone, I found something weird happening with a pointer: Take the following code: int x=0, n=10, *px=&x, *py=NULL; printf ("BEFORE: valeur de px = %p et py = %p\n\n", px, py);...
1
by: Eric Dev | last post by:
Bonjour, Au secours aidez moi, Comment inserter une valeur nul dans un champs datetime j'ai essayé mais l'application converti automatiquement le vide en 01/01/1900 que faire ?
2
by: Bernard Bourée | last post by:
I have a class named VALEUR which contains some properties like KEY and NAME I have built a hashtable named VALEURS with a code like: Valeurs.Add(Valeur.Key, Valeur) in a loop I want to have...
4
by: icony | last post by:
Bonjour, je veux faire une requête qui selectionne seulement les mots qui contiennent disons "afe" Le problème est que je voudrais que cette partie de mot provienne d'une table qui change de...
1
by: donny | last post by:
HEllo, I've found a script (at this url http://www.thescripts.com/forum/thread84554.html ) that is like the things i want to do; i want to parse my xml file and modify the value of an attribute;...
11
by: cbderby | last post by:
''permission denied'' ''id returned 1 exit status'' im compiling with dev c++ 4.9.9.2 im using windows vista, but i have compiled and ran other programs before. pretty simple program, some...
0
by: David Kemp | last post by:
Hi, I am using asp.net (vb.net) to access a set of 3rd party web services and have successfully accessed some of them, however, when I try to access a particular web service, I get the following...
5
by: Pascal | last post by:
Hello This is, below, a piece of code that I have a problem with: In the program (french description here http://www.scalpa.info/carre_install_clickonce/aide_carre.htm) a number is generated...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.