473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

referencing onclick()

15
Hi

Im finding this so confusing & painful to learn.

My problem is with referencing onclick script correctly, do you use the HTML name=xyz or id=abc as the reference?

For example, how do I correctly reference these in my onclick script:

[HTML]
<input name="btnShowCityInfo" type="button" id="btnShowCityInfo" value="Show City Info" onclick="showCityInfo()"/></td>

<input name="btnSetDefaultCity" type="button" id="btnSetDefaultCity" value="Save this City as your Default City" onclick="setDefaultCity()"/>
[/HTML]

Thanks
Oct 9 '07 #1
2 1075
dmjpro
2,476 2GB
Hi

Im finding this so confusing & painful to learn.

My problem is with referencing onclick script correctly, do you use the HTML name=xyz or id=abc as the reference?

For example, how do I correctly reference these in my onclick script:

[HTML]
<input name="btnShowCityInfo" type="button" id="btnShowCityInfo" value="Show City Info" onclick="showCityInfo()"/></td>

<input name="btnSetDefaultCity" type="button" id="btnSetDefaultCity" value="Save this City as your Default City" onclick="setDefaultCity()"/>
[/HTML]

Thanks

What is happening buddy ?

Debasis Jana
Oct 10 '07 #2
gits
5,390 Expert Mod 4TB
hi ...

what to you want to do? onclick you call a function ... and what do you want to refer to - refer something within that function? or pass something to it that has to be refered before? please explain your problem in more detail ... so that we may get your point.

kind regards
Oct 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Simon | last post by:
Am using the following code. <script language="JavaScript1.2"> function setquantity(productindex,productquantity) { //create the reference object irefname_none = eval("document." +...
16
by: Robert Mark Bram | last post by:
Hi All! Is there a way to reference a window by name without doing something like this: open (, 'windowName'); The open method will open a blank window if there is no window with such a name....
2
by: Reply Via Newsgroup | last post by:
Folks, Windows, and refering to them (be they in seperate frames or in a popup) always catch me... There is parent, top, self, the name of the window itself and where it sits when refering to...
5
by: hibernate | last post by:
I'm somewhat new to javascript/DHTML, and this problem has been plaguing me. I have made an 'array' of <div> tags within my html document like so: <div id="menu"> menu1 </div> <div id="menu">...
2
by: amerar | last post by:
Hi All, I'm not a javascript programmer, but I'm trying to accomplish something here that is not working. I have 2 buttons on an HTML form, along with several text fields. If Button #1 is...
2
by: libsfan01 | last post by:
Hi all How do u reference the id (and also now i think about it the name) of the enclosing div tag of a form element such as a button or div tag (without specifying its name)? I've tried:...
6
by: George Slamowitz | last post by:
Hello all I have a HTML control generated by the following: INPUT TYPE="hidden" NAME="MyAnswer" VALUE="" Is there a way to reference the Value of this control using VB program code??? ...
2
by: Ian :\) | last post by:
Hi Just learning JavaScript and I'm trying to reference radio buttons generated by php, the relevant lines are: <td width="9%" align="center" class="bg-tb-td"><input name="editArticle"...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.