Form, auto change value

14 views
Skip to first unread message

Maciej Bąk

unread,
Oct 1, 2012, 9:25:16 AM10/1/12
to lif...@googlegroups.com
Hello,

I Have form like this:
<div class="lift:dodaj_deleg">
 <form class="lift:form.ajax">
 <span style="font-size:10px;">
 Gdzie od: <input name="gdzie_od1"/> Data od: <input name="data_od1" id="data_od1"/> <br/> 
 Gdzie do: <input name="gdzie_do1"/>   Data do: <input name="data_do1"  id="data_do1"/><br/><br/>
 ...
  z dnia: <input name="poleceniezdnia"  id="poleceniezdnia"/><br/>
 </div>
 
When I choose "data_do1" ( I use jquery date and time picker to choose date ) I want to auto change value of "poleceniezdnia" ( poleceniezdnia = data_do1 ).

This is from snippet:
 def render = {   
    "name=data_od1" #> SHtml.text(data_od1, data_od1 = _) &
    "name=data_do1" #> SHtml.text(data_do1, data_do1 = _) &
    "name=gdzie_od1" #> SHtml.text(gdzie_od1, gdzie_od1 = _) &
    "name=gdzie_do1" #> SHtml.text(gdzie_do1, gdzie_do1 = _) &
   ...
  }
  
  Any ideas how to do it ? I read abot ajax forms but then i have no idea how to use jquery in it to choose date ;/

Diego Medina

unread,
Oct 1, 2012, 10:08:28 AM10/1/12
to lif...@googlegroups.com
See if this example does what you are trying to do

http://jqueryui.com/demos/datepicker/#alt-field

When you set the date on the field on the left, some value gets
populated on the right field.

Regards,

Diego
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>
>



--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com
Reply all
Reply to author
Forward
0 new messages