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

Code does not seem to do what it should

I am currently using php to output the javascript and was just
wondering if my syntax was correct as the code does not seem to work

<form action="" method="post" name="myform">
<input name="test" type="text" />
<input name="test2" type="text" onclick="document.myform.test2.value =
document.myform.test.value" />
<input name="test3" type="text" />
<input name="test4" type="text" onclick="if
(document.myform.test4.value == document.myform.test3.value) {
document.getElementById(a).innerHTML='Some Text'}" /> <div id="a"> bob
</div>

</form>

is part of what the php outputs, and the specific section I am having a
problem with is the onclick section of test4 any help would be greatly
appreciated, Thankyou

Jun 16 '06 #1
2 1179
sh********@gmail.com wrote in news:1150431182.452515.111770
@p79g2000cwp.googlegroups.com:
I am currently using php to output the javascript and was just
wondering if my syntax was correct as the code does not seem to work

<form action="" method="post" name="myform">
<input name="test" type="text" />
<input name="test2" type="text" onclick="document.myform.test2.value =
document.myform.test.value" />
<input name="test3" type="text" />
<input name="test4" type="text" onclick="if
(document.myform.test4.value == document.myform.test3.value) {
document.getElementById(a).innerHTML='Some Text'}" /> <div id="a"> bob
</div>

</form>

is part of what the php outputs, and the specific section I am having a
problem with is the onclick section of test4 any help would be greatly
appreciated, Thankyou


Just put single-quotes around the "a":
document.getElementById('a')

Your code now works in IE and Firefox.
Jun 16 '06 #2
Those small mistakes get me every time, thankyou for your help.

Jun 16 '06 #3

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

Similar topics

9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
6
by: bissatch | last post by:
Hi, I have been tryin to run free dhtml code from a web page. The web page is: http://dynamicdrive.com/dynamicindex14/pixelate.htm When I load the page above it opens as normal and the...
13
by: R Reyes | last post by:
is there a way to avoid the validateRequest error page in my code behind file? i can't seem to find a way to handle the error w/o an error code or exception being thrown... i am NOT looking for...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
9
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
9
by: waltbrad | last post by:
For an exercise I had to write a class that would do math operations on complex numbers. The main point of the exercise was overloading various operators. One of them was the conjugate operator...
19
by: William Gill | last post by:
I seem to be having a mentally bad period lately . My code is beginning to be terrible convoluted mess, and I shudder to think what it will be like to go back in a couple months and try to follow...
42
by: lorlarz | last post by:
Contrary to what one authority in the JavaScript field says: JavaScript does make errors when dealing with just with integers. This authority (Douglas Crockford.) says: "integer arithmetic in...
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
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?
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
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...
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...

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.