473,396 Members | 2,029 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,396 software developers and data experts.

Populate textbox in new window

Hi guys,
Lots of threads and ideas, but I couldn't find what I'm looking for.
Hence, this.

I have asp page (say, 1.asp) that has a textbox. This page is available
to me in read-only mode, meaning I know all the field names, functions
names etc., but can't change anything.

Now, I need to write .htm or .asp (2.htm or 2.asp) that will have a
textbox and submit button. When user clicks on submit two things have
to happen:
1) 1.asp opens in new browser window
2) textbox in 1.asp gets populated with textbox value from 2.htm (or
2.asp)

It may sound like piece of cake, but it's turned into a problem for me.
Any help would be appreciated.

Aug 12 '05 #1
1 2814
ASM
got4a wrote:
Now, I need to write .htm or .asp (2.htm or 2.asp) that will have a
textbox and submit button. When user clicks on submit two things have
to happen:
1) 1.asp opens in new browser window
2) textbox in 1.asp gets populated with textbox value from 2.htm (or
2.asp)

It may sound like piece of cake, but it's turned into a problem for me.
Any help would be appreciated.


as I understood the two forms (1.asp and 2.htm)
are exactly same (except button to send infos to 1.asp)

function pop() {
if(!(!truc) || !truc.closed) truc.close();
truc=window.open('1.asp','','width=300,height=250' );
txfer();
}
function txfer() { // copy content of each textbox from 2 to 1
var a = document.forms[0].elements;
var b = truc.document.forms[0].elements;
for(var i=0;i<b.length;i++) if(a[i].type=='text') b[i].value=a[i].value;
}

in file '2.htm' :

<input type=button onclick="pop();"
value="Open Pop-Up and Transfer Datas">
</form>

or with your case (only 1 textbox + 1 submit button)

file '2.htm' :

<html>
<script type="text/javascript">
function pop() {
var a = document.forms[0].elements[0];
if(a.value.length<1) {
alert('Fill the field of text')
a.focus(); a.select();
}
else {
if(!(!truc) || !truc.closed) truc.close();
truc=window.open('1.asp','','width=300,height=250' );
var b = truc.document.forms[0].elements[0];
b.value = a.value;
alert('that\'s done');
}
}
</script>
<form onsubmit="pop();return false;">
Name : <input type="text">
<input type="submit" value="OK">
</form>
</html>
--
Stephane Moriaux et son [moins] vieux Mac
Aug 12 '05 #2

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

Similar topics

2
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to...
0
by: anna | last post by:
I have a grid with some columns that are BOUND columns. I have three more columns that are TEMPLATE columns with textboxes inside. i need to populate one of the textboxes with information based on...
2
by: Mark | last post by:
I am attempting to populate several textbox controls from VBA code. With each attempt, I get the following error: "The macro or function set to the BeforeUpdate or ValidationRule property for...
1
by: Celine | last post by:
how can we populate a textbox using information from database, using asp.net and c#
2
by: Junior | last post by:
Hi All, I haven't got a response for this question lately and i really need to get this done ASAP. I have a .aspx page that has table two column four rows on it. 1. How do i use codebehind C#...
4
by: Mori | last post by:
I am using masterPage and I need to populate a textbox that is in a content control with data from popup page that is not part of the master page. This code works if no masterpage is involved. ...
11
by: eureka | last post by:
Hi All, I'm training in Servlets, JSP and JavaScript, I have a web page in which there's a "StudentName" textbox and below it is a "Names" Dropdown list. Initially the Textbox is empty and...
1
by: rjainx | last post by:
I am using masterPage and I need to populate a textbox that is in a content control with data from popup page that is not part of the master page. here is the javascript produced: ...
1
by: sudip2008 | last post by:
When using the Calendar Popup in a content page of a masterpage the strForName is always set to aspnetForm This breaks this line from working properly window.opener.document.forms...... How can...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...

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.