473,563 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copying cell contents (text) into an input field

15 New Member
Hi Everyone,

I am creating a search facility that holds titles and SKU numbers. When the results appear in a 2 column table I would like the title to go into an input (readonly) field and the SKU to go into a different input field. I have the code below to help visualise what I am trying to do.

I think what I want is similar to a calendar where you can select the date you want and it appears in an input field - this I can do, but can't figure out how to do simple text.

I would also like to do the opposite - Typing into an input field and the text appearing into a table cell.

I hope that makes sense, any help would be great.

HTML doc

[HTML]<body>
<tr>
<td>
Title<br>
<input name="title" type="text" size="55" readonly="true" >
<a href="Javascrip t:void" onClick="window .open('search.h tml','window', 'width=550, height=610, scrollbars=1')" >Go</a>
</td>
</tr>

<tr>
<td>
SKU<br>
<input name="sku" type="text" size="55" readonly="true" >
<a href="Javascrip t:void" onClick="window .open('search.h tml','window', 'width=550, height=610, scrollbars=1')" >Go</a>
</td>
</tr>
</body>
[/HTML]
Search HTML doc (search.html)

[HTML]<table width="200">
<tr>
<td>Hello</td>
<td>FSDU/789789/0408</td>
</tr>
</table>
[/HTML]
Thank you
Mar 26 '08 #1
1 1398
acoder
16,027 Recognized Expert Moderator MVP
Give your input elements IDs so you can easily refer to them.

To refer to the parent window from the child (search) window, use window.opener. So, to change the value of the input field, use
Expand|Select|Wrap|Line Numbers
  1. // assuming you have the value 
  2. window.opener.document.getElementById("title").value = val;
If you need more hints, let me know.
Mar 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5694
by: Carl | last post by:
I'm trying to select, with the mouse, a cell within a flexgrid that I've created, and copying the contents of that cell to the clipboard. I've tried using the Mousecol and Mouserow properties to return the cell col and row index, but It doesn't seem to RETURN the cell ID but needs an argument identifying, seemingly the col and row...
1
7878
by: Dom Nicholas | last post by:
Hi, I have a table (inside a form) that is dynamically created ie the user can add / remove rows dynamically. Each table row has 4 columns : a selection pull down list a text field for entering an amount a check box a button
12
1772
by: Adam Lipscombe | last post by:
Folks, I need to get the contents of a form attribute. In Read/Write mode this is field, so I can use getElementById("name").value In ReadOnly this is just plain text, so I can use getElementById("name").innerText. I need to do it dynamically though, so is there anyway I can look at the object returned by getElementById() and determine...
1
8433
by: Ratnest | last post by:
Hi, I'm new to Microsoft Access today, so this is probably a very basic question for all you clever people out there. Anyone know how I copy down a column in Microsoft Access? It doesn't seem to have the same functionality as Excel, i.e. I can't just write in one cell and then drag this down or highlight a whole column and have the...
1
3534
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say black for example). I am dynamically creating the LinkButton controls and adding them into the table cell and I've also hooked up an event handler for...
2
2185
by: Maziar Aflatoun | last post by:
Hi, I have a datagrid which binds to a datareader dgXXXXX.DataSource = rdr; dgXXXXX.DataBind(); On dgXXXXX_EditCommand I can read the value of the selected row( e.Item.ItemIndex) which works. How can I read the contents of that cell. I have the following code which doesn't work.
7
3095
by: Arne Beruldsen | last post by:
in vbnet2005 I have a datagridview. When the user clicks on a row...I would like the contents of certain cells to populate a textbox. To do this...i need to be able to refer to the row and colums...something like textbox = contents (rx, cx) How can I refer to the cell contents? Thanks....
2
2893
by: hotflash | last post by:
Hi Master CroCrew, I found a good PURE ASP that will allow you to upload 10MB file to the server and the file contents such as Network, Author, Title, etc... will insert to MS Access at the same time. Below is a working script that I used. Let's say after the file is uploaded to the server and a record created with the file contents above...
0
7664
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7885
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. ...
1
7638
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...
1
5484
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...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
923
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...

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.