[Lift] Re: The value is missing when i use the DatePicker to post data to the Server ?

2009-10-27 Thread Neil.Lv


  I print the S.attr and get something like this:  ...Left(form)..
  println(S.attr)

  And how can i get the form value from the form that posted to the
server.

  I can't get the date_time value via the DatePicker.

  Thanks for any help!

Cheers,
  Neil


On Oct 28, 9:17 am, Neil.Lv anim...@gmail.com wrote:
 Hi all,

I use the datepicker to chose the date, and the value is missing
 when posted to the server.

 1:
This is some code:

 ###   In the model
 object date_time extends MappedDateTime(this) {
 final val dateFormat =
   DateFormat.getDateInstance(DateFormat.SHORT)
 override def asHtml = Text(dateFormat.format(is))
   }
   ...

bind(e, form,
  date_time - text(, date = _) % (size - 10) % (id - 
 entrydate),

  submit - submit(S.??(add), checkAndSave))
 ###

 ###   in the html page
   head
  .
head
tr
   tddate_time:/td
   tde:date_time eid=entrydate live:maxlength=10date_time/
 e:date_time/td
 /tr
   ...

   script type=text/javascript
 $(function() {
   $('#entrydate').datepicker({dateFormat:'yy/mm/dd'});
 });
   /script
 ###

   When the submit button clicked, the date_time doesn't have the
 value .  --text(, date = _)
 ###
   date_time - text(, date = _) % (size - 10) % (id -
 entrydate),
 ###

  2: I want to save the date_time into the database and the format is
 like this,  2009-10-27 13:38:11,

 but the DatePicker only contains the date not the time, How can i
 achieve this purpose ?

 ###
 object created_at extends MappedDateTime(this) {
 override def defaultValue = new Date()
 }
 ###

Thanks for any suggestion !

 Cheers,
   Neil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: The value is missing when i use the DatePicker to post data to the Server ?

2009-10-27 Thread Naftoli Gugenheim

I think you want S.param, not S.attr.
Is the form being submitted via GET? What do you see in the URL string? Look 
first at the HTML source to see the name attribute generated by Lift--it's 
different each time.

-
Neil.Lvanim...@gmail.com wrote:



  I print the S.attr and get something like this:  ...Left(form)..
  println(S.attr)

  And how can i get the form value from the form that posted to the
server.

  I can't get the date_time value via the DatePicker.

  Thanks for any help!

Cheers,
  Neil


On Oct 28, 9:17 am, Neil.Lv anim...@gmail.com wrote:
 Hi all,

I use the datepicker to chose the date, and the value is missing
 when posted to the server.

 1:
This is some code:

 ###   In the model
 object date_time extends MappedDateTime(this) {
 final val dateFormat =
   DateFormat.getDateInstance(DateFormat.SHORT)
 override def asHtml = Text(dateFormat.format(is))
   }
   ...

bind(e, form,
  date_time - text(, date = _) % (size - 10) % (id - 
 entrydate),

  submit - submit(S.??(add), checkAndSave))
 ###

 ###   in the html page
   head
  .
head
tr
   tddate_time:/td
   tde:date_time eid=entrydate live:maxlength=10date_time/
 e:date_time/td
 /tr
   ...

   script type=text/javascript
 $(function() {
   $('#entrydate').datepicker({dateFormat:'yy/mm/dd'});
 });
   /script
 ###

   When the submit button clicked, the date_time doesn't have the
 value .  --text(, date = _)
 ###
   date_time - text(, date = _) % (size - 10) % (id -
 entrydate),
 ###

  2: I want to save the date_time into the database and the format is
 like this,  2009-10-27 13:38:11,

 but the DatePicker only contains the date not the time, How can i
 achieve this purpose ?

 ###
 object created_at extends MappedDateTime(this) {
 override def defaultValue = new Date()
 }
 ###

Thanks for any suggestion !

 Cheers,
   Neil


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---