473,791 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object names with square bracket

Hi,
i want to update several Textboxes by reading the value of another
Box. For that i use the following small script:

<form name="form1" method="POST">
<input type="text" name="xx" value ="1"
onBlur="documen t.form1.tex1.va lue=document.fo rm1.xx.value">< br>
<input name="tex1" type="text" size=16 maxlength=80 value="1">
</form>

Everything works fine, but for my PHP-Script i need square brackets [
]. If i try to add them, my Script got an error:

<form name="form1" method="POST">
<input type="text" name="xx" value ="1"
onBlur="documen t.form1.tex[1].value=document .form1.xx.value "><br>
<input name="tex[1]" type="text" size=16 maxlength=80 value="1">
</form>

Whats wrong?

Thanks!
Jul 23 '05 #1
1 1939
Hello

This is a common issue.

Access the named object from javascript as:

theForm["elementNam e"].value = xyz .... or
theForm.element s["elementNam e"].value = "asdasda";

Example:

theForm["tex[1]"].value = xxxxxxxxxxxx... .............

HTH,
Elias
"Nalpo" <fg*@mikroplan. com> wrote in message
news:d3******** *************** ***@posting.goo gle.com...
Hi,
i want to update several Textboxes by reading the value of another
Box. For that i use the following small script:

<form name="form1" method="POST">
<input type="text" name="xx" value ="1"
onBlur="documen t.form1.tex1.va lue=document.fo rm1.xx.value">< br>
<input name="tex1" type="text" size=16 maxlength=80 value="1">
</form>

Everything works fine, but for my PHP-Script i need square brackets [
]. If i try to add them, my Script got an error:

<form name="form1" method="POST">
<input type="text" name="xx" value ="1"
onBlur="documen t.form1.tex[1].value=document .form1.xx.value "><br>
<input name="tex[1]" type="text" size=16 maxlength=80 value="1">
</form>

Whats wrong?

Thanks!

Jul 23 '05 #2

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

Similar topics

4
4123
by: Geoff Cox | last post by:
Hello, One person to date has received a runtime error message saying "parent.frameleft.location is not an object" with the following code. The code is used to select 2 frames at the same time... Any ideas why please? Geoff
6
2344
by: Luke | last post by:
Here is my emails to Danny Goodman (but probably he is very busy so he didn't answered it). First email(simple): Subject: JavaScript Arrays " We all know the array can act like HashMap, but is there a shortcut for creating such array ? eg //simple array indexed via numbers var a = new Array("a", "fdsf", "sada"); or,
9
5578
by: Christine | last post by:
It has come to my attention that sometimes, when I open a Query in SQL View, the SQL that I see is not exactly the same as the SQL in the Query's Querydef. The difference I see (only occasionally) has to do with square brackets and dot on some tblName.FieldName portions of the query. The following routine demonstrates how I see the QueryDef's SQL: Sub DbgQuery(sQryName As String) '' Prints the SQL for the given query to the Debug Window...
5
5023
by: sfeher | last post by:
Hi All, I need to call a function(loaded with appendChild) for which I have the name as a string. .... var fnName = 'fn1'; var call = fnName + '('+ param +' )'; eval(call);
19
2637
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I access a property of an object using a string? ----------------------------------------------------------------------- There are two equivalent ways to access properties: the dot notation and the square bracket notation. What you are looking for is the square bracket notation in which the dot, and the identifier to its right, are replaced with a...
3
2949
by: balakrishnan.dinesh | last post by:
Hi frnds, Im having a problem in searching out a particular substring in a string. Here the code: --------------------- <html> <script> var tmpString=" ";
0
10427
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10155
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9995
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.