2 Replies - 388 Views - Last Post: 07 May 2013 - 05:18 AM

#1 EPTRemain  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 81
  • Joined: 25-May 11

Insert CheckBox based on userinput (yes/no)

Posted 03 May 2013 - 02:34 AM

In this piece of code, users are supposed to fill in a form.
I retrieve the details and save it to a database table.

My issue is, I want to make my form dynamic. e.g - there are questions which require a yes/no checkbox selection from the user. Is it possible to insert additional textboxes based on the user selection?


                                <h:outputText value="Are you presenting a paper?"/>
                                <h:panelGrid columns="2">
                                    <p:selectOneRadio id="paperOptions" value="#{conference.paperOption}">  
                                        <f:selectItem itemLabel="Yes" itemValue="1" />  
                                        <f:selectItem itemLabel="No" itemValue="2" />
                                    </p:selectOneRadio>
                                </h:panelGrid>

                                <p:outputLabel for="yesReason" value="If YES, title of paper:"/>
                                <p:inputText id="yesReason" value="#{conference.yesReason}"/>   

                                <p:outputLabel for="author" value="Specify all authors and affiliations:"/>
                                <h:inputTextarea id="author" value="#{conference.author}"/>

                                <p:outputLabel for="noReason" value="If NO, special reason for attendance:"/>
                                <p:inputText id="noReason" value="#{conference.noReason}"/>        


Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Insert CheckBox based on userinput (yes/no)

#2 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: Insert CheckBox based on userinput (yes/no)

Posted 07 May 2013 - 05:08 AM

It looks like you're using JSF? PrimeFaces? Just a clarification for anyone who might be able to help you. I was going to offer a couple of options, but since you're using JSF neither of them will work. Sorry.
Was This Post Helpful? 0
  • +
  • -

#3 EPTRemain  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 81
  • Joined: 25-May 11

Re: Insert CheckBox based on userinput (yes/no)

Posted 07 May 2013 - 05:18 AM

View PostProgrammist, on 07 May 2013 - 02:08 PM, said:

It looks like you're using JSF? PrimeFaces? Just a clarification for anyone who might be able to help you. I was going to offer a couple of options, but since you're using JSF neither of them will work. Sorry.

Hi, sorry for my bad clarification.

I am using PrimeFaces.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1