I want to create a dynamic question site, with some scroll, check, and whatever boxes. After the user send the form, i want to use the informations, to create dynamicly an answer. I tried a lot, but couldn't get it to work properly. So I hope, you may help.
get_event( 'Event_1', 1 ).
get_event( 'Event_2', 5).
get_component( 'Type_1', 'Component_1' ).
get_component( 'Type_2', 'Component_2' ).
get_incident( 'Incident_1' ).
get_incident( 'Incident_2' ).
index( Request ) :-
reply_html_page(
[
title('Questions')
],
[
form( [ id( search ), action(answer), method(post)],
[
h1('All Questions'),
div( [ h4('Question_1')
|\selection ]),
div( [ h4('Question_2')
|\component ]),
div( [ h4('Question_3')
|\event ]),
input( [ type( submit ), value( 'Submit' )])
])
]).
event -->
{ event( Ls ) },
html( [ div( Ls )]).
event( Ls ) :-
findall( span( [ input( [ value = Priority, name = Event, type = 'checkbox' ] ), Event ] ), get_event( Event, Priority ), Ls ).
component -->
{ component( Ls ) },
html( [ div( Ls )]).
component( Ls ) :-
findall( div( [ input( [ name = Component, value = [Type, ',', Component ], type = 'checkbox' ]), Component ]), get_component( Type, Component ), Ls ).
selection -->
{ selection( Ls ) },
html( [ div( select( Ls ))]).
selection( Ls ) :-
findall( option( [ name = Incident, value = Incident ], Incident ), get_incident( Incident ), Ls ).
Now i want to use this information as post parameters. I found 2 solutions, http_parameters/3 and with member( method(post), Request)... , but wasn't able to bring it to work. How can i print all this parameters on a website?