Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6138737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:54:13+00:00 2026-05-23T17:54:13+00:00

I do have this code on my demo.gsp file. But I´m new to grails

  • 0

I do have this code on my demo.gsp file. But I´m new to grails and I don´t really know very well how to retrieve the value of the input on my Controller to validate it like i.e “inputResult==”hi” then ok else bad”.

<g:form action='${postUrl}' method='post' id='loginForm' class='cssform' autocomplete='off'>
 <p>
   <label for="password">
    <g:message code="access.code"/>:
   </label>
 </p>
 <p>
   <input name="j_password" class="loghominput" id="password" type="password"/>
 </p>
 <div class="greenbutton2">
  <a href="#" onclick="document.getElementById('loginForm').submit(); return false">
  <g:message code="home.enter"/></a><input type="submit" style="display:none" value="Enter"/>
 </div>
</g:form>

My Controller is like this.

class AskDemoController {

    def demo = {

    }
}

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:54:14+00:00Added an answer on May 23, 2026 at 5:54 pm

    You can access parameters submitted by your form in the controller by using the params object. Something like this…

    def somethingInTheForm = params.nameOfTheParam;
    
    if (somethingInTheForm){
       render 'good'
    }else{
       render 'bad'
    }
    

    Take a look here for documentation.

    However – i would suggest going through some to the Tutorials to gain a better understanding of the power of grails.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this demo code for iTextSharp Document document = new Document(); try {
I have this code: def setVelocity (x, y, yaw) setVelocity (Command2d.new(x,y,yaw)) end def setVelocity
I have this code but I just can't understand it. using System; using System.Collections.Generic;
I have tried so many things but I don't understand this sooo confusing. I
Ok, I know this seems like a duplicate question, but don't think it is.
Possible Duplicate: Can someone Explain this jQuery code? I have posted this before, but
I have this code attached to a button If htmlText.Contains(<frame src='demo.html'/>) Then htmlText =
I have been playing with the demo code from this msdn article by Jeffrey
I have downloaded this code; http://www.cs.sfu.ca/%7Emori/research/superpixels/superpixels64.tar.gz In the readme file, it says; Run mex
I have code like this: function demo() { this.val=5; function() { this.val=7; }(); }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.