Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Captcha for feedback #161

Open
sneumann opened this issue Nov 14, 2024 · 0 comments
Open

Captcha for feedback #161

sneumann opened this issue Nov 14, 2024 · 0 comments

Comments

@sneumann
Copy link
Member

Consider

https://www.primefaces.org/showcase/ui/misc/captcha.xhtml?jfwid=5192a

Captcha.xhtml

<div class="card">
    <h:form>
        <p:messages showDetail="true"/>
        <p:captcha label="Captcha"/>
        <br/>
        <p:commandButton value="Check" action="#{captchaView.submit}" ajax="false" icon="pi pi-check"/>
    </h:form>
</div>

CaptchaView.java

@Named
@RequestScoped
public class CaptchaView {

    public void submit() {
        FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Correct", "Correct");
        FacesContext.getCurrentInstance().addMessage(null, msg);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant