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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:08:38+00:00 2026-05-12T00:08:38+00:00

So I am trying to invoke methods on a page and I know the

  • 0

So I am trying to invoke methods on a page and I know the values that I want to put inside the methods but I can’t seem to get the syntax to work. I feel so, well.. lamerized.

Ok so here is the javascript method on the page

function ReturnValue (sValue, sText) 
{
     window.focus();
     var oForm = document.EditForm;

     switch (szType)        // Form element name
     {
     case 'agt':
        oForm.agt.value = sText;
        oForm.agentman.value = sValue;
        oForm.agtid.value = sValue;                              
        oForm.getagt.focus();
        break;

     case 'county':     
        oForm.County.value = sValue;
        sCurrentCounty = new String(sValue);
        document.all("CountyDisp").innerHTML = sText;
        document.all("City").value = "";
        document.all("CityDisp").innerHTML = "";
        document.all("Area").value = "";
        document.all("AreaDisp").innerHTML = "";
        break;
   default:
        break;      
     }  // End switch
 return;
}

Very straight forward function and you would assume that the parameters were strings, right?
So in the IE8 Script Debugger Console I tried this:

ReturnValue(“adf”,”asdf”);
//FAIL
“Object expected”

Object expected huh, well maybe I need single quotes for the strings I assumed next (just in case).

ReturnValue(‘adf’,’asdf’); //FAIL
“Object expected”

Okay, just making sure.. So I need an object that stores a string. How about using a var I thought..

var o = “adf”; var p = “dfsa”; ReturnValue(o,p); //FAIL “Object expected”

I tried with single quotes just to be sure. So after all that I am sure an object is needed. So I tried to create an Object.

o = new Object(); k = new Object(); //{…}

Now I from here I didn’t know how to add a string to an object so I just did this.

o.value = “text”; k.value = “field”; // “text” … “field”

Okay so now I am feeling excited I have an object with some string in there so now I try to put it all together again.

ReturnValue(o,z)
// EPIC FAIL “Object expected”

I am putting Objects in there! Now I’m back to square one, can someone help?

Okay problem still not solved.

Upon further investigation I found that the script does infact run once at the very beginning of the page load. I can debug and break and while its paused through the code I can run the methods. But after I release and it finishes declaring all the variables I can’t run any methods. But, for some reason the same method that I am trying to run is able to run from a Popup using the Window.Opener.ReturnValue(string,string);

I dont get it!

Javascript guru’s where are you when I need you!

  • 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-12T00:08:38+00:00Added an answer on May 12, 2026 at 12:08 am

    Assuming you’ve defined szType somewhere else, I pasted this function into a scratch page and played around with it and I can’t reproduce this issue in IE8 (or FireFox 3).

    Googling around, the only thing I found was a reference saying that if you set the script type incorrectly you might get this as IE won’t parse the script block at all. Is your script block set as “text/javascript”?

    If that doesn’t work, can you provide more of the code involved (perhaps the markup too)?

    On another note, you might want to look at using something like jQuery or one of the other JS libraries. Browser-specific JS like this is evil (death to document.all).

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

Sidebar

Ask A Question

Stats

  • Questions 152k
  • Answers 152k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This code should do the trick. It checks where the… May 12, 2026 at 10:10 am
  • Editorial Team
    Editorial Team added an answer No, there are not any plans for RSTP support, AFAIK. May 12, 2026 at 10:10 am
  • Editorial Team
    Editorial Team added an answer Try it, DataTable dt=new DataTable(); dt.Columns.Add("No",typeof(int)); // Adding column into… May 12, 2026 at 10:10 am

Related Questions

I have a DBAdmin class that connects to the database, and then some other
I've wrapped most of wininet with no problems, but now I'm stuck. I am
I have a ProgressBar that uses the marquee style when a report is being
This is a two part question. A dumb technical query and a broader query

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.