Hi Web2py Users,
*In drop down, I have some values like Due today , Due Tomorrow , Due
Tomorrow. When user will select any option from the drop down. I want to
fetch the data from the table according to the option. if I will select
due today, Only today date record should be shown. if i select this
month,Only monthly record should be shown I am not able to under stand how
i can convert the string into date. and compare with database. def
abc():Model*
db.define_table('Bithday',
Field('Name',label='name'),
Field('assignment','text'),
Field('bdate','date')
*View*
function showcnf()
{
var x=document.forms["cnf"]["sub"].value;
if (x==null || x=="")
{
alert("Please select the value ");
return false;
}
</script>
<form name="cnf" action="{{=URL('default','subquery')}}" method="post"
onsubmit="return showcnf()" >
<select name="sub">
<option value="Due Today">Due Today</option>
<option value="Due Tommarow">Due Tomorrow</option>
<option value="Due This Month">Due This Month</option>
</select>
<input type="submit" value="Submit">
</form>
Controller
def abc():
option=request.vars.sub
task = db(db.'Bithday.bdate == Option).select()
response.flash = T("its working !")
return dict(task = task)
can any one can help me in this
Thanks
Rohit Raj Sharma
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.