473,394 Members | 1,739 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.

window.opener with <select>

Hi

There is a <select name='city'item with <optionin the HTML <form
name='france'>
I have tried using the following in a JS routine:
<a
href="javascript:window.opener.document.france.cit y.options[21].selected=true;
window.close();"></a>

I get
Error Line 0
'window.opener.document.france.city.options.21 is null on not an object

Is the syntax correct?

I have tried the following on an <input type='text' and it works OK.
<a href="javascript:window.opener.document.france.ind ustry.value='iron';
window.close();"></a>

Regards
John

--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 97721 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
Mar 26 '07 #1
2 2497
ASM
John a écrit :
>
I get
Error Line 0
'window.opener.document.france.city.options.21 is null on not an object
probably you haven't 22 options in this select ?

href="javascript:if(window.opener.document.france. city.options[21])
window.opener.document.france.city.options[21].selected=true"

href="javascript:if(window.opener.document.france. city.length>21)
window.opener.document.france.city.options.selecte dIndex=21"

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Mar 26 '07 #2

"ASM" <st*********************@wanadoo.fr.invalidwrote in message
news:46**********************@news.orange.fr...
John a écrit :
>>
I get
Error Line 0
'window.opener.document.france.city.options.21 is null on not an object

probably you haven't 22 options in this select ?

href="javascript:if(window.opener.document.france. city.options[21])
window.opener.document.france.city.options[21].selected=true"

href="javascript:if(window.opener.document.france. city.length>21)
window.opener.document.france.city.options.selecte dIndex=21"

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Je pense que vous avez trouve la reponse. If me faut verifier le nombre des
<option>s qui existent.
Merci.

John


--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 97810 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
Mar 26 '07 #3

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

Similar topics

2
by: Andrea | last post by:
Hi, I'm trying to emulate part of our client-server application as a web site so customers can use it, and I'm stuck when it comes to re-ordering items in a list. Basically we have a list of...
1
by: Ang Talunin | last post by:
Hey, I wondering if it's possible to retrieve all the <option>-fields from a <select> when posting a <form> to a php file Example: I've got a form like this: <form action = phpfile.php...
6
by: Bonge Boo! | last post by:
This has got to be obvious, but I can't make it work. I have a form called with 3 pull down menus. They are linked to a database which generates the values for the <SELECT? Pull-downs. Lets...
4
by: joiv | last post by:
I'm making a <select></select> with lots of <option></option>. It contains all possible options. Because of the length of the list, I also have an <input type="text">. This is what I wish to do:...
5
by: Brian Foley | last post by:
Hello, I am used to using the label tag with check boxes and radio buttons in html forms. This allows me to click on the text of the label to activate/deactivate the check box / button, rather...
6
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this...
6
by: joseph.lindley | last post by:
Forgive me for I am a bit of a web-dev novice - but I'm not doing too bad. I'm currently working with a bit of javascript to dynamically add <option>s into a select box. My code currently works...
4
by: Man-wai Chang | last post by:
-- iTech Consulting Co., Ltd. Expert of ePOS solutions Website: http://www.itech.com.hk (IE only) Tel: (852)2325 3883 Fax: (852)2325 8288
14
mikek12004
by: mikek12004 | last post by:
In a form I have 5 elements (e.g. pictures) and I wish for the user to be able to set the order of appearance. For this I have for each picture a select box (names select1 to select5) with "please...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.