PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.smarty.general > value with html_select_date
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
value with html_select_date

Réponse
 
LinkBack Outils de la discussion
Vieux 15/08/2006, 04h34   #1 (permalink)
rei
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut value with html_select_date


--------------------------------------------------------
{html_select_date prefix="s_" end_year=+1 month_format=%m day_format=%02d
field_order="YMD" field_separator="-"}
--------------------------------------------------------
i had my SELECT tag written as above.
i've stated that my day_format should be %02d , but why the HTML tags appear
like the following?

---------------------------------------------------------
<select name="s_Day">
<option label="01" value="1">01</option>
<option label="02" value="2">02</option>
<option label="03" value="3">03</option>
・・・
</select>
---------------------------------------------------------
i just cant get the value to be
value="01"

--
View this message in context: http://www.nabble.com/value-with-htm....html#a5808351
Sent from the Smarty - General forum at Nabble.com.
  Réponse avec citation
Vieux 15/08/2006, 09h17   #2 (permalink)
messju mohr
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] value with html_select_date

hi,

On Mon, Aug 14, 2006 at 08:34:12PM -0700, rei wrote:
>
> --------------------------------------------------------
> {html_select_date prefix="s_" end_year=+1 month_format=%m day_format=%02d
> field_order="YMD" field_separator="-"}
> --------------------------------------------------------
> i had my SELECT tag written as above.
> i've stated that my day_format should be %02d , but why the HTML tags appear
> like the following?
>
> ---------------------------------------------------------
> <select name="s_Day">
> <option label="01" value="1">01</option>
> <option label="02" value="2">02</option>
> <option label="03" value="3">03</option>
> ?????????
> </select>
> ---------------------------------------------------------
> i just cant get the value to be
> value="01"


AFAIK you can not do that. but since you have to check *all* incoming
request variables for range and consistency anyway, you could simply
format the day when it comes back from the form. like:

$date = sprintf("%04d-%02d-%02d", $_REQUEST['s_Year'], $_REQUEST['s_Month'], $_REQUEST['s_Day']);
  Réponse avec citation
Vieux 16/08/2006, 05h33   #3 (permalink)
rei
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] value with html_select_date


hi messju,

i see!
and yeah,, i should have thought of sprintf
i m just too stupid..
thanks !



messju mohr wrote:
>
> hi,
>
> On Mon, Aug 14, 2006 at 08:34:12PM -0700, rei wrote:
>>
>> --------------------------------------------------------
>> {html_select_date prefix="s_" end_year=+1 month_format=%m day_format=%02d
>> field_order="YMD" field_separator="-"}
>> --------------------------------------------------------
>> i had my SELECT tag written as above.
>> i've stated that my day_format should be %02d , but why the HTML tags
>> appear
>> like the following?
>>
>> ---------------------------------------------------------
>> <select name="s_Day">
>> <option label="01" value="1">01</option>
>> <option label="02" value="2">02</option>
>> <option label="03" value="3">03</option>
>> ?????????
>> </select>
>> ---------------------------------------------------------
>> i just cant get the value to be
>> value="01"

>
> AFAIK you can not do that. but since you have to check *all* incoming
> request variables for range and consistency anyway, you could simply
> format the day when it comes back from the form. like:
>
> $date = sprintf("%04d-%02d-%02d", $_REQUEST['s_Year'],
> $_REQUEST['s_Month'], $_REQUEST['s_Day']);
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


--
View this message in context: http://www.nabble.com/value-with-htm....html#a5824435
Sent from the Smarty - General forum at Nabble.com.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h53.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10023 seconds with 11 queries