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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:35:57+00:00 2026-06-11T01:35:57+00:00

Friends I have following code in a javascript function that is assigned to onblur

  • 0

Friends I have following code in a javascript function that is assigned to onblur event on <input type="text" name="rate" />. #NewOrder is a div and input[name=quantity] is also a input type="text". These both input elements are inside #NewOrder div.

function addMaterial() {
    var qnty, rate;
    if (Number($('#NewOrder input[name=quantity]').val()) > 0) {
        qnty = Number($('#NewOrder input[name=quantity]').val())
    }

    else {
        alert('Invalid Quantity');
        $('#NewOrder input[name=quantity]').focus(); // ** Working
        return;
    }
    if ($('#NewOrder input[name=rate]').val().length == 0) {
        rate = 0;
    }
    else {
        if (!Number($('#NewOrder input[name=rate]').val() > 0)) {
            alert('Invaid Rate');     // ** Working
            alert($('#NewOrder input[name="rate"]').val()); // ** Working
            $('#NewOrder input[name="rate"]').focus();      // ** Not Working
            $('#NewOrder input[name="rate"]').trigger('focus'); // Also not Works
            return;
        }
        else
            rate = Number($('#NewOrder input[name=rate]').val());
    }
    var mat = getMaterialFromArray($('#mats').find(':selected').text());
    $('#mats').focus();
}

Friends where I am going wrong..? What thing am I missing..??
It is irritating me.
While alert($('#NewOrder input[name="rate"]').val()); says the actual value, means control is being selected using jQuery.
But neither $('#NewOrder input[name="rate"]').focus(); nor $('#NewOrder input[name="rate"]').trigger('focus'); works.

Added Live Version Link
try accessing http://a.bobdn.com use ‘111’ as Investor No. and ‘abc’ as password. Then navigate to Material -> New Order and pleeease look what is wrong there.

  • 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-11T01:35:59+00:00Added an answer on June 11, 2026 at 1:35 am

    It seems to be a bug in Firefox. In Chrome your code is working as it should.
    For support in Firefox you can create a function like:

    function setFocus(controlSelectorString) {
        setTimeout(function() {
            $(controlSelectorString).focus();
        }, 0);
    }
    

    Jsfiddle

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

Sidebar

Related Questions

I have the following code to allow users to invite thier Facebook friends: function
I have the following backbone.js code and i have a problem in that event
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have the following code: class Employee { friend string FindAddr( list<Employee> lst,string name
I have the following friends = [{ name: Jack, attr1:def, attr2:def }, { name:
I have the following JavaScript code to publish/post a message to friend's Wall, as
Hi friends i want know sectionIndexTitlesForTableView Action is works i have the following code...
When the page loads I have an initial replaceWith that runs the following code:
friends, i have written following layout code and buttons to be displayed on screen
I currently have the following code coming from a database table: <h1 class=widgetHeader>My Friends</h1>

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.