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 8085761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:13:53+00:00 2026-06-05T18:13:53+00:00

var search= document.getElementById(‘appMenu’).value document.location.href= ‘${createLink(controller: ‘application’ , action:’ajaxAppSearch’, params: [‘query’: search])}’ The element appMenu

  • 0
var search= document.getElementById('appMenu').value 
document.location.href= '${createLink(controller: 'application' , action:'ajaxAppSearch',   params: ['query': search])}'

The element appMenu is a text field, so I am getting the value that the user enters into the text box to pass into a search controller. However, it keeps telling me that the params query is null. It seems that search isn’t being passed into the create link method. Anyone have a suggestion?

  • 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-06-05T18:13:55+00:00Added an answer on June 5, 2026 at 6:13 pm

    Grails (controllers, GSP and tags, etc) are working on server side. JavaScript on client side. And this link is prepared before sending data to browser, and before JavaScript can pass its variable into GSP tag.

    But you can prepare base link on server side, and add extra parameter on client side, by using javascript, like:

    var search= document.getElementById('appMenu').value;
    document.location.href= '${createLink(controller: 'application' , action:'ajaxAppSearch')}?query=' + escape(search);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code var file = getUrlVars()[file]; if(file){ document.getElementById('search').value = file; } function
<script type=text/javascript> var geo = new GClientGeocoder(); function showAddress() { var search = document.getElementById(search).value;
<script type=text/javascript> var haystackText = document.getElementById(navigation).innerHTML; var matchText = '<a href=http://mydomain.co/?feed=rss>Subscribe to RSS</a>'; var
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
var test = document.body.getElementsByTagName(a); for (var i=0; i<test.length; i++) if(test[i].innerHTML().indexOf(search string) != -1){test[i].style.color=black;} Hopefully
var test = http://www.example.org/search?q=whatever&another=moretext; How can I extract another 's value ( moretext )
I've started to wrap my functions inside of Objects, e.g.: var Search = {
Lets say we have a simple alghoritm for highlighting search results: var patt =
I am putting a search field in a gridpanel toolbar like this: var searchGrid
var pre = '<a href=someDirectoryPath'; var mid = '.aspx>'; var post = '</a>'; var

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.