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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:42:36+00:00 2026-06-01T17:42:36+00:00

var filterMinPV = $(‘.hidePVVol > td input:first’).val(); var filterMaxPV = $(‘.hidePVVol > td input:last’).val();

  • 0
var filterMinPV = $('.hidePVVol > td input:first').val();
var filterMaxPV = $('.hidePVVol > td input:last').val();

Currently they are set to an empty string if the input box is empty. I log these values currently with console.log.

Is it possible to give these values the value of “NULL”, the only way I can see of doing this is possibly putting the if statement inside of the val(). But is there a better way perhaps some chaining function I am missing?

So if the input box has a value I want it assigned to the var. If it is an empty string I want “NULL” assigned to the var.

Hope I explained that well enough!

  • 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-01T17:42:37+00:00Added an answer on June 1, 2026 at 5:42 pm
    var filterMinPV = $('.hidePVVol > td input:first').val() || null;
    var filterMaxPV = $('.hidePVVol > td input:last').val() || null;
    

    Not that it helps anything as you still need to test for null somewhere and you might as well test for the empty string instead.

    You might wanna avoid querying the same element sets for this complex selector twice by:

    var inputs =  $('.hidePVVol > td input'),
        filterMinPV = inputs.first().val() || null,
        filterMaxPV = inputs.last().val() || null;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var ref1 = new Firebase(http://gamma.firebase.com/myuser/123,456); ref1.set(123,456); var on1 = ref1.on(value, function(snapshot) { console.log(snapshot.val()); });
var $imagefile = $('<input />') .attr({ type: 'file', name: 'imageFile', id: 'imageFile' }); Above
var S: string; begin SetLength(S, MAX_SIZE);// when casting to a PChar, be sure the
var stringToHighlight = [userinput] // may be any string like foo, bar or .
var listOfStates = from n in _storageStates select n.tag; If n.tag is a string
var a = [i] earned [c] coin for [b] bonus; How to get string
var currentLeft = $(this).css('left'); if((currentLeft%2)== 0){ thisLeft = currentLeft; } I want to set
var pagebacklinks = new Array(); pagebacklinks[jQuery('#somevalue').val()][something] = 33; ERROR I GET ABOVE IS: pagebacklinks[jQuery(#somevalue).val()]
var hdn_add_element_cnt = $(#hdn_add_element_cnt).val(); alert(hdn_add_element_cnt); $('#element_area').append(<div id=\'foobar\'>This is my text <div id=\'del_1\' onclick=\'return delete_element(\hdn_add_element_cnt\);\'>Remove</div></div>);
var firstValue = $(this).find('.feedback-selected').val(); var secondValue = $('.feedback-selected').val(); alert(firstValue); alert(secondValue); <script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js></script> <div> <input

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.