pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Input Forms
2+ messages / 2 participants
[nested] [flat]

* Input Forms
@ 2001-03-25 16:01  Paul Joseph McGee <mcgee@student.cs.ucc.ie>
  0 siblings, 0 replies; 2+ messages in thread

From: Paul Joseph McGee @ 2001-03-25 16:01 UTC (permalink / raw)
  To: pgsql-php

Hi 

I have a table in my database which has a column of type date. When I
retrieve the date from the database, I brake it up into seperate
variables, as in $day, $month, $year. My problem is that I give the user
the chance to change the date that is in the database so I have 3
input/text fields that the user change select the day, month and year. BUT
I want the selected day, month, year to be the one that is in the database
so the user will then decide if that date is alright. 

I don't know how to do this, would it be javasript, and if so would it be
something like onload???

Thanks

Paul





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Input Forms
@ 2001-03-26 00:28  Chris <csmith@squiz.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Chris @ 2001-03-26 00:28 UTC (permalink / raw)
  To: Paul Joseph McGee <mcgee@student.cs.ucc.ie>; pgsql-php


>Hi
>
>I have a table in my database which has a column of type date. When I
>retrieve the date from the database, I brake it up into seperate
>variables, as in $day, $month, $year. My problem is that I give the user
>the chance to change the date that is in the database so I have 3
>input/text fields that the user change select the day, month and year. BUT
>I want the selected day, month, year to be the one that is in the database
>so the user will then decide if that date is alright.
>I don't know how to do this, would it be javasript, and if so would it be
>something like onload???

You can do it with PHP.. as you're going through the select list, do a check -

     # For the days list box....
for ($days = 1; $days < 32; $days++) {
     echo "<option value=".$days;
     if ($days == $your_days) {
         echo " SELECTED";
     }
     echo ">".$days."\n";
}

this is the way i usually do it, works pretty well.. :) Of course, it can 
be written differently, but that's up to you..

HTH

------------------------
Chris Smith
http://www.squiz.net




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-03-26 00:28 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-25 16:01 Input Forms Paul Joseph McGee <mcgee@student.cs.ucc.ie>
2001-03-26 00:28 Re: Input Forms Chris <csmith@squiz.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox