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

  • Home
  • SEARCH
  • 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 6656119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:36:15+00:00 2026-05-26T01:36:15+00:00

CFM <html> <head> <title>Test Page</title> <script type=text/javascript> function toggleV(value){ document.getElementById(‘blah’).value = value; } </script>

  • 0

CFM

<html>
<head>
<title>Test Page</title>
<script type="text/javascript">
    function toggleV(value){
        document.getElementById('blah').value = value;
    }
</script>
</head>
<body>
<cfform name="coolfrm">
    <cfinput type="hidden" name="blah" id="blah" value="default">
    <a onclick="toggleV('anothervalue')" style="cursor:pointer;">click Me</a>
</cfform>

<cfdiv bind="cfc:TestCFC.func({coolfrm:blah})"></cfdiv>

</body>
</html>

CFC

<cfcomponent>
    <cfscript>
        remote function func(simpleString){
            return simpleString;
        }
    </cfscript>
</cfcomponent>

What I expect this code to do is change the text in the cfdiv from “default” to “anothervalue”.

This doesn’t work the way I think it should, and I would like to know why.

  • 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-26T01:36:16+00:00Added an answer on May 26, 2026 at 1:36 am

    By definition from: http://www.w3.org/TR/html4/interact/scripts.html

    The onchange event occurs when a control loses the input focus and its
    value has been modified since gaining focus.

    The change event isn’t firing correctly when you modify the field programmatically.

    Solve this by changing the JavaScript function slightly:

    function toggleV(value){
        document.getElementById('blah').value = value;
        ColdFusion.Event.callBindHandlers('blah',null,'change');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made this nice little table: testPage.cfm: <html> <head> <title>Test Page</title> <style> .blue{
I have code that looks something like this: <html> <head> <script type=text/javascript src=http://code.jquery.com/jquery-latest.min.js></script> <script
Rather than population said DOM object with an external page such as HTML CFM
I would like to turn the HTML generated by my CFM page into a
I am passing value of text-area in a.cfm in variable of GetXmlHttpObject to b.cfm
In a simple aspx page I can have a custom JavaScript function postback as
I am having a little bit of a trouble with the following: <script> $(document).ready(function()
I am working on the following page. http://www.ranger.ryerson.ca/library/test/steveDev/testcarousel/test.html it works in firefox, chrome, and
I have the following jQuery get: $.get(rssread.cfm?number=10, function (d) { $('#feedContent').append($(d).html()); }); The get
I have a Function in CFC file, which will be called from .cfm file

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.