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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:36:33+00:00 2026-06-07T02:36:33+00:00

I am pretty good with Coldfusion and passing variables in forms through the web

  • 0

I am pretty good with Coldfusion and passing variables in forms through the web via URL. I cannot wrap my head around this mobile stuff yet. I am developing an app that pulls from a database on my server. I have 2 calls to the server now that just pulls data without any “where” statement and they work great. I want to add a search input that will have what the user types in the box to go in my query on my .cfc. Not sure how to pass that data from the phone form to the cfc on my server.

Here’s the search button code…

<form action="searchresult.html" method="post"  data-transition="none">
    <input type="search" name="mySearch" 
           id="mySearch" value="" data-mini="true" data-theme="b" />
</form>

This is my script code in XCode that should run when the search is submitted…(i don’t know where to put any variable to pass to the cfc. Can it be passed in the URL?)

$("#resultPage").live("pageshow", function() {
    console.log("Getting remote list" + event.notification);
    $.mobile.showPageLoadingMsg();
    $.get("http://www.mywebsite.com/jquery/ryprad.cfc?
                      method=getsearch&returnformat=json", 
        {}, 
        function(res) {
            $.mobile.hidePageLoadingMsg();
            var s = "";
            for(var i=0; i<res.length; i++) {
                s+= "<li><a name=" + res[i].id + " + href='" 
                    + res[i].showlink + "'>" 
                    + res[i].date + "<br/>" + res[i].name + "<br/>" 
                    + res[i].description + "</a></li>";
            }

            $("#resultList").html(s);
            $("#resultList").listview("refresh");
            },
        "json"
    );
});

And this is my cfc on the server…

component {
remote array function getsearch() {
    var q = new com.adobe.coldfusion.query();
        q.setDatasource("myDat");
        q.setSQL("
            select id1, Date, ShowLInk, IntName, description from RYPRadio 
            Where intName 
            LIKE '%#VARIABLE_FROM_PHONE_SEARCH#%' 
            order by date desc"
        );
        var data = q.execute().getResult();
        var result = [];
        for(var i=1; i<= data.recordCount; i++) {
            arrayAppend(
                result, 
                {
                    "id"=data.id1[i], 
                    "name"=data.IntName[i], 
                    "date"=dateformat(data.date[i], "mmmm d, yyyy"), 
                    "description"=data.description[i], 
                    "showlink"=data.ShowLInk[i]
                }
            );
        }
        return result;
    }
}

I hope someone can help with this. If I can get this working, it will help me develop other things that will pass variables such as this!

  • 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-07T02:36:34+00:00Added an answer on June 7, 2026 at 2:36 am

    Add the search string to the jquery call:

    $.get("http://www.mywebsite.com/jquery/ryprad.cfc?method=getsearch&returnformat=json&searchName="+ $("#mySearch").val(), {}, function(res) {
    

    And add an argument in ColdFusion:

    remote array function getsearch( searchName ) {
    

    And adjust your query accordingly. You should use a param for this like so:

    q.setSQL("select id1, Date, ShowLInk, IntName, description from RYPRadio Where intName LIKE :searchParam order by date desc");
    q.addParam( name="searchParam", value="%#searchName#%" );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my jQuery skills are pretty good normally but this is driving me mad! It's
Until recently I'd considered myself to be a pretty good web programmer (coming up
I'm reading this introductory book on parsing (which is pretty good btw) and one
I want to modify this code which works pretty good but (or I don't
This works pretty good except it is limited to 10 posts since my blog
I've been pretty good at fixing my Xcode Obj-C errors, but this one has
Usually i am pretty good at working my way round as3 but this one
We use Auto Scaling and it works pretty good for us, but this morning
I am usually pretty good to write simple regular expressions, but this time I
This site is pretty good but I'm wondering what other resources are out there.

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.