here is one possible solution (may contain typos)

def index():
    form1=SQLFORM(db.electrical_ticket)
    form2=SQLFORM(dbmechanical_ticket)
    if form1.accepts(..): ...
    if form2.accepts(..):....
    return dict(form1=form1,form2=form2)

in view/default/index.html

<form>
<select name="type" id="ticket_type">
<option value="electical">electrical</option><option
value="mechanical">mechanical</option>
<select>
</form>
<div class="myform electrical">{{=form1}}</div>
<div class="myform mechanical">{{=form2}}</div>

<script>
function hide() { $(".myform").hide(); }
$(document).ready(function() { hide(); });
$("#ticket_type").change(function() { hide(); $('.'+$(this).val
()).slideToggle(); })
</script>

Massimo

On Feb 18, 6:37 pm, rick hess <[email protected]> wrote:
> Guys;
>
> So I'm brand new to web2py but I have a need to create a web2py
> application that has the capability of creating trouble tickets for
> our physical plant/facility. For instance we'll have an electrical
> ticket, a plumbing ticket, a mechanical ticket etc. So far I have
> defined a table to represent each trouble ticket type. What I would
> like to do is to have a "drop down" on an introductory form that
> allows a user to select the trouble ticket type which will then allow
> the user to fill in the form for that ticket type.
>
> So for instance a user can select/highlight electrical ticket from the
> introductory screen drop down, which then brings up the electrical
> ticket form, fill out the electrical ticket, and then save it to the
> database electrical ticket table.
>
> So I've looked high and low through the 'WEB2PY' manual as well as
> this google group and can't find an example on a drop down with this
> kind of functionality.
>
> Can someone point me to an example that illustrates this kind of
> mechanism.
>
> Thanks in advance
>
> Regards
> Rick Hess
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to