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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:08:37+00:00 2026-06-05T02:08:37+00:00

I really don’t know what the issue is here. As far as I can

  • 0

I really don’t know what the issue is here. As far as I can see, the code is simple and should work fine.

          var Prices="";
          for (var PriceCount = 1; PriceCount <= 120; PriceCount++) {
              var CurrentPrice = "Price" + PriceCount;
              if (prevDoc.getElementById(CurrentPrice).value != null) {
                  if (Prices == "") {
                      Prices = prevDoc.getElementById(CurrentPrice).value;
                  } else {
                      Prices += "," + prevDoc.getElementById(CurrentPrice).value;
                  }
              } else {
                  break;
              }
          }

There could be up to 120 hidden inputs on the form. The moment we check for an input that doesn’t exist the loop should break. My test page has two input elements that get pulled. On the third (the null) I get this error in firebug:

prevDoc.getElementById(CurrentPrice) is null

 if (prevDoc.getElementById(CurrentPrice).value != null) {

Yes it is null…that’s what the check is for ಠ_ಠ

Does any one know what I’m doing wrong? This seems like it should be really straight forward.

EDIT:
for clarity’s sake, prevDoc=window.opener.document

  • 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-05T02:08:39+00:00Added an answer on June 5, 2026 at 2:08 am
    if (prevDoc.getElementById(CurrentPrice).value != null) {
    

    can be expanded to:

    var element = prevDoc.getElementById(CurrentPrice);    
    var value = element.value; /* element is null, but you're accessing .value */
    
    if (value != null) { 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really don't know if it's a Netbeans issue but here's the problem: In
I really don't understand what the issue is here, I've tried everything I can
I really don't know why this doesn't work. It seems so simple. The current
I really don't know where the fault is all about. Here is my code:
Sorry i really don't know how to code in PHP but i need to
I have a homework problem that I really don't know how to start. Here
I really don't understand why this function doesn't work: function GetNomRepertoireTemporaire:WideString; var PathLocal :
That can be silly question but I really don't know the reason. // i
Ok guys I'm really at a dead end here, don't know what else to
Simple question: I really like the idea of encapsulation, but I really don't know

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.