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

not able to get output

Hi!,
I am trying to use js.
What I trying to do is that:
I have a text box, below/under that I use a IFRAME.
On IFRAME I have some rows of data.

Now I trying that when I click any one row or name of the IFRAME that
name / row data will come to text box,

on TEXT part I use [form name-- newnew]:
<b>Name:</b></td><td><input name="name1" type="text" size="34"
maxlength="33" onkeyup="showname(this.value)">

on IFRAME part I use:
<iframe name="test" align="top" frameborder="0" src ="./xyz.php"
width="250" height="55" scrolling="auto" marginheight="0"
marginwidth="0" onclick="seltxt(this.value)">
</iframe>
on JS part I use:
function seltxt(str)
{
document.iframe.getElementById("test")=document.fo rm["newnew"].getElementById('name1').value
}

Dec 11 '06 #1
2 2313
for accessing an element of main frame in iframe you need to use
"parent"
<input type='text' id='name1' >
something like
parent.document.form["newnew"].getElementById('name1').value to access
the textbox.

also in your code you have missed the ID attribute in input tag without
that "getElementById" won't work. same goes for IFrame also

On Dec 11, 10:52 am, "Sukalyan" <e...@rediffmail.comwrote:
Hi!,
I am trying to use js.
What I trying to do is that:
I have a text box, below/under that I use a IFRAME.
On IFRAME I have some rows of data.

Now I trying that when I click any one row or name of the IFRAME that
name / row data will come to text box,

on TEXT part I use [form name-- newnew]:
<b>Name:</b></td><td><input name="name1" type="text" size="34"
maxlength="33" onkeyup="showname(this.value)">

on IFRAME part I use:
<iframe name="test" align="top" frameborder="0" src ="./xyz.php"
width="250" height="55" scrolling="auto" marginheight="0"
marginwidth="0" onclick="seltxt(this.value)">
</iframe>

on JS part I use:
function seltxt(str)
{
document.iframe.getElementById("test")=document.fo rm["newnew"].getElementById('name1').value

}
Dec 11 '06 #2
theCancerus wrote:
for accessing an element of main frame in iframe you need to use
"parent"
<input type='text' id='name1' >
something like
parent.document.form["newnew"].getElementById('name1').value to access
the textbox.

also in your code you have missed the ID attribute in input tag without
that "getElementById" won't work. same goes for IFrame also
Trying to call - getElementById - as a method of a form element is
going to error anyway as it is only a method of documents.

Richard.

Dec 11 '06 #3

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

Similar topics

6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to go through the database -> forms collection and...
58
by: Jeff_Relf | last post by:
Hi Tom, You showed: << private const string PHONE_LIST = "495.1000__424.1111___(206)564-5555_1.800.325.3333"; static void Main( string args ) { foreach (string phoneNumber in Regex.Split...
14
by: Kay Schluehr | last post by:
One of the main reasons Pythons anonymous function lambda is considered to be "broken" is Pythons disability to put statements into expressions and support full functionality. Many attempts to...
7
by: Matt B | last post by:
I have a need to alternate output row colour where not every row in the sequence is output, so I cannot base the colour on whether position() is odd or even. e.g. .... <xsl:for-each...
8
by: Peter A. Schott | last post by:
Per subject - I realize I can copy/paste a line at a time into an interactive session when I'm trying to debug, but was wondering if there is any tool out there that allows me to copy sections of...
0
by: perryche | last post by:
This may have been missed, so I appoglize if I am reposting this. (I also want to thank Larry and James for their previous help) All, Table1 Field1 Field2 Field3 Field4 ......
1
by: ssubbarayan | last post by:
Gurus, One of my friend mailed me this sample piece of code: #include <stdio.h> main() { int a,b,c; int count = 1; for (b=c=10;a="- FIGURE?, UMKC,XYZHello Folks,\ TFy!QJu ROo TNn(ROo)SLq SLq...
3
by: Dhananjayan | last post by:
Hi, I have a java webservice running on Axis, Iam able to create a java client to invoke the webservice and obtain the result. But iam not able to invoke the service from .Net client.. Here are...
4
by: Jay | last post by:
Hello all, I was wondering if someone can point me to a tutorial that show me how I can set up a web service that can listen for me to send a POST from a client? like so Client sends http...
14
by: masaniparesh | last post by:
Hi Friends, The basic issue is "To read stdin and stdout in the same program" The following program is i have wrote using thread but i figured out that stdout is working but it is not working when...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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,...

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.