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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:29:38+00:00 2026-05-14T14:29:38+00:00

I have a CFINPUT tag in a CFFORM . I want to set the

  • 0

I have a CFINPUT tag in a CFFORM. I want to set the range dynamically without posting the page. I have several AJAX calls throughout the page to dynamically load form fields on the fly:

<cfselect id="this" name="this" bind="cfc:Data.getThis()" bindonload="true" />

<cfselect id="that" name="that" bind="cfc:Data.getThat({p1})" />

<cfselect id="theOther" name="theOther" bind="cfc:Data.getTheOther({p1}, {p2})" />

<cfdiv 
    id="maxQty" 
    bind="cfc:Data.getMaxQty({itemId})" />

<cfinput 
    type="text" 
    id="qty" 
    name="qty" />

<cfdiv 
    id="itemId" 
    bind="cfc:Data.getItemId({this}, {that}, {theOther})" />

In the above CFFORM, I basically want to set the minValue of the range to “1” and the maxValue of the range to the value of cfc:Data.getMaxQty({itemId}).

Is this possible? How can I do it?

  • 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-14T14:29:38+00:00Added an answer on May 14, 2026 at 2:29 pm

    The quick answer is “No”. But there is a very easy workaround. Simply load the value that you want to be the maximum into a CFDIV or a CFINPUT hidden field using binding, then access that value in a JavaScript function that validates the min/max values when you submit the form:

    <script type="text/javascript">
    <!--
    
    function validateForm() {
        var maxQty = document.getElementById("maxQty").innerHTML;
    
        if (document.myForm.add_item_1.value < 1 || document.myForm.add_item_1.value > maxQty) {
            alert("Quantity must be an integer value between 1 and " + maxQty);
    
            return false;
        }
    
        return true;
    }
    
    //-->
    </script>
    
    <cfform name="myForm" method="post" action="myFormAction.csm" onsubmit="return validateForm();">
    
    <cfdiv 
        id="maxQty" 
        bind="cfc:Data.getMaxQty({itemId})" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can the cfinput tag be set to validate the minimum input length? (E.g.
I have Parent page and a Child page('empW.cfm'),which is nothing but a popup window
Have finally got a responsive site working (of a fashion). What I want to
Have posting working wonderfully, and reading the response happily EXCEPT when one of the
Have the following cronjob set up in root's crontab: (centos 5.x) 2 * *
Have a long running set of discrete tasks: parsing 10s of thousands of lines
I am using CF8 and MySQL 5. I have a form with several date
I have made this nice little table: testPage.cfm: <html> <head> <title>Test Page</title> <style> .blue{
Have started playing with Xcode 4.2, and created a single page application using storyboard
have the following implementation $.ajax({ type: POST, url: /Member/SaveMember, data: $('form').serialize(), success: refreshGrid() how

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.