473,394 Members | 1,717 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,394 software developers and data experts.

Title in Select

Hi,

I have got this html, javascript code

<html>
<head>
function get()
{
alert(document.form1.xyz.value);
alert(document.form1.xyz.title);
return true;
}
</head>
<body>
<form method="get" name="form1" id=form1>
<table>
<tr>
<td><select id=xyz name=xyz onChange="javascript:get();">
<option value="-1">------ select a name-------</option>
</td>
</tr>
</table>
</form>
</body>
</html>

The first alert statement will print the value -1, i need to know if the 2nd
alert statement
will print "-------select a name---------"?
Is there anything like title property exists, if so can you please correct
me on how to use it.
Your help is highly appreciated.
Regards
Venkat


Jul 20 '05 #1
3 3737

"Venkat" <ve*******@yahoo.com> schreef in bericht
news:1060283483.906500@sj-nntpcache-5...

The first alert statement will print the value -1, i need to know if the 2nd alert statement
will print "-------select a name---------"?
Is there anything like title property exists, if so can you please correct
me on how to use it.


alert(document.form1.xyz.text);
JW


Jul 20 '05 #2
"Janwillem Borleffs" <jw*@jwbfoto.demon.nl> wrote in message
news:3f***********************@news.euronet.nl...


alert(document.form1.xyz.text);
JW

Jan thanks for a response but i am afraid this is not working, it gives me a
value "undefined".

Venkat

Jul 20 '05 #3
Janwillem Borleffs wrote:
"Venkat" <ve*******@yahoo.com> schreef in bericht
news:1060283483.906500@sj-nntpcache-5...

The first alert statement will print the value -1, i need to know if the

2nd
alert statement
will print "-------select a name---------"?
Is there anything like title property exists, if so can you please correct
me on how to use it.


alert(document.form1.xyz.text);

JW


var theSelect = document.forms['form1'].xyz;
alert(theSelect.options[theSelect.selectedIndex].text);

<url: http://jibbering.com/faq/#FAQ4_13 />

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: schmendrick | last post by:
Does anyone know how to disable the dbl click on the title bar? I have a full screen progam that I dont want moved or closed or anything. Took care of everything except for the fact that if you...
3
by: Bill | last post by:
I'm trying to pull up all the titles in our database that have a word like the one submitted from our search form. The string is like this: title=request.form("title") sql=" SELECT * FROM...
2
by: Flyzone | last post by:
Hi all, i have a little problem.... in the XML i have a tag named "title", where there is the text that i want to use for the title of the card name in the resul WML. The problem is that i cant...
33
by: bissatch | last post by:
Hi, I fully understand the purpose of an alt attribute within a <img> tag but why would you use a title or summary attribute within, for example, a <p> tag. I have read books recommending that I...
3
by: kscheu via AccessMonster.com | last post by:
I am using OutputTo to export a query to excel, prompt the user to save as and then open the excel file. See below: DoCmd.OutputTo acOutputQuery, "q701ExportFields", acFormatXLS, , True 'Opend...
6
by: RoomfulExpress | last post by:
Here's the problem that I'm having- I'm trying to pull in 2 fields from my database and place them in the title of the HTML. I'm connecting to the db and selecting everything exactly the same as I am...
2
by: BASSPU03 | last post by:
I used the Common Dialog API to store file paths on my form's underlying table. These paths are displayed in a textbox that I can click to open the selected file. Having stored the file paths in...
1
by: plsHelpMe | last post by:
Hi All, i am having a multi select something like this <select id="id1" name="selectName" multiple="multiple" size="24" style="width: 228px;" onclick="addBttnHilight()" ;=""> <option...
2
by: Stuartsblog | last post by:
Is it possible to return the Page title in php ? I can return the end of the url with $_SERVER however it is the "Page Title" that I require. Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.