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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:04:49+00:00 2026-05-24T20:04:49+00:00

I created this fiddle that the div value changes based on your dropdown list

  • 0

I created this fiddle that the div value changes based on your dropdown list selection. http://jsfiddle.net/qSkZW/20/

I want to take it one step further and this is to create a textbox field that if you add for example the number 2 it will change the div value to 240 (in real the 120 you find in the script it will be a php var). If it writes 3 then to 360.

Additionally there must be two limitations.

  1. Prevent them from using non-numeric characters.
  2. The maximum number is pre-configured (from a php variable). Like if the max value is set to 10, if the user writes 30 it will return to 10.

Thank you for your help.

  • 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-24T20:04:50+00:00Added an answer on May 24, 2026 at 8:04 pm

    Okay, so first, create a textfield (example id=”textfield”), then modify your listener’s action to

    $("#quantity").change(function () {
        var price = parseInt($(this).val(), 10)*120
        $("#textfield").attr('value="'+price+'"');
        # sets the default value of #textfield to the selection from #quantity
        })
    .change()
    
    $("#textfield").blur(function () {
    # when the element looses focus (they click/tab somewhere else)
            var valid = /^\d{2}$/;
            # this means any 2 numbers. change {2} to {3} or however many digits.
            # you can also also use d[0-10] to identify a range of numbers.
    
        if ( $(this).text() != valid ) {
            $("#message").text("Only numbers please!");
            $("#message").fadeIn();
            # add <span id="message" style="display:none;"></span> next to #textfield
            # enclose #textfield & #message in the same element (like <li> or <div>)
        }
        else {
            $("#message").fadeOut();
        }
    });
    

    Could you please provide more info about #2 (I don’t have a clear understanding of what is supposed to happen)

    Quick question: why are you trying to put a price in an editable element?

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

Sidebar

Related Questions

I am new in JQ. I have created this fiddle here: http://jsfiddle.net/SZ6mY/7/ All I
In this fiddle http://jsfiddle.net/SySRb/40/ , I created an array with two elements, #f-ONE and
I have this fiddle which has an error --> http://jsfiddle.net/Osoascam/AkZZr/6/ (This is the version
Consider this jsfiddle: http://fiddle.jshell.net/maple/JbEJN/show/ (this is the result window, in order for replaceState to
As you can see in this fiddle, http://jsfiddle.net/S8Bne/64/ , I am trying to draw
I've created this regex (www|http://)[^ ]+ that match every http://... or www.... but I
I created this fiddle so that you can see what i am trying to
http://jsfiddle.net/motocomdigital/7fyvn/1/ Hello, this is a question I'm really struggling to find an answer for.
Some time ago I created this LAMP based web. At the time I wrote
I've created this code branch so that if the permalink settings do no match

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.