Another question about a Javascript form

I have a hard time accepting "that" something works, I need to know "why" in order to feel like I really understand what's going on. That said, I've got a question about a JavaScript form:

<span onmouseover="this.style.textDecoration='underline';"
onmouseout="this.style.textDecoration='none'" //like a link, user sees the "add physician" text underlined when the mouse over it

onclick='loadlookup  //going to call a function when the user clicks on the "add physician" text

(dataform,"physician_lookup",entityid,physicianid,physician,"physician")'>add physician</a>

The above code, from what I'm learning, is a function that is called when the user clicks on "add physician." Thing is, it's not just a function, is it? It's actually instantiating a form object, correct? I'm basing this on http://javascript.about.com/od/hintsandtips/ss/domscriptwalkthrough.htm.

That being the case, I want to understand what "dataform" is. The actual function is:

function loadlookup(form, page, entityid, id, name, label) {
      lookuplabel.innerHTML = '<span class=\'legend\'>Click name to add:</span>  '+label;

The first element being "form," is what defines this as an object versus a mere function, correct? But what is the significance of "dataform" as far as the way it's being called?

I want to be able to get my mental arms around that.
brucegustPHP DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Carl TawnSystems and Integration DeveloperCommented:
dataform should be a reference to a javascript variable declared elsewhere, which is being passed to the function. I would guess that it is somewhere higher up in the page and probably holds a reference to the <form> element in your page.

If you have a copy of your page available somewhere that we could see then it would be easier to be more specific.
0
brucegustPHP DeveloperAuthor Commented:
Carl, you nailed it. I found it as I was going through some code down the page and BOOM! Epiphany! Thanks!
0
Julian HansenCommented:
The above code, from what I'm learning, is a function that is called when the user clicks on "add physician."
Correct
Thing is, it's not just a function, is it? It's actually instantiating a form object, correct?
No, it is just a function. Instantiating an object requires the new operator which is not in evidence. The function might create an object but there is no way of telling from the way it is called.
The first element being "form," is what defines this as an object versus a mere function, correct?
Nope - it is just a function.
And as Carl pointed out dataform is just a variable declared somewhere on your page. If it is in quotes or a number it is a value if it is a string without quotes it is a variable declared somewhere else.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brucegustPHP DeveloperAuthor Commented:
I get it. After looking at the code closer and trying to digest it more, the function isn't instantiating a form as much as it's just compiling the variables that will be used in an iframe down the road. Thanks, guys!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.