473,396 Members | 1,743 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.

Pop-Up Pass Multiple Dynamic Values Between Forms

Hello,

Thanks for taking a look at this!

Problem:
I'm trying to pass multiple dynamic values between a slaveform and a
masterform. The problem I'm having is on the slaveform I loop through
multiple records and want two values depending on the row they select.

slaveform: x=selected
Radio ID Location
x 1 1
2 2
3 3
..
..
..

So in the slaveform I want the ID=1 and Location=1 passed back to the
masterform. Since the row has been selected by selecting the radio
button. I'm using ASP to loop through the records of the database if
this makes any difference.

I would really appreciate an example or suggestions if you guys have
any.

Thanks !
Jul 23 '05 #1
4 2529
Hey,

To return the information you can alway use opener. opener refers to the
parent document that opened the window. Something like:

if (opener && !opener.closed && opener.returnedValues) {
opener.returnedValues(id, location);
}

returnedValues is a function you have to write in the master form.

Now there are several ways to solve the other problem. You could build
an additional array, or you could make multiple hidden fields, but I
would think the following would be the easiest. You could integrate the
values in the radiobutton. For example, you could do the following:

<INPUT TYPE="radio" NAME="list" VALUE="1,0"> ID 1, Location 0
<INPUT TYPE="radio" NAME="list" VALUE="2,1"> ID 2, Location 1
<INPUT TYPE="radio" NAME="list" VALUE="3,2"> ID 3, Location 2

Now once you press 'the' button you can do the following

function sendBackValues()
{
list = document.myform.list;
for (i=0;list.length;i++)
{
if (list[i].checked) {
if (opener && !opener.closed && opener.returnedValues)
{
values = list[i].value.split(',');
opener.returnedValues(values[0], values[1]);
return;
}
}
}
alert('No options checked!');
}

Good luck,
Vincent
cwwilly wrote:
Hello,

Thanks for taking a look at this!

Problem:
I'm trying to pass multiple dynamic values between a slaveform and a
masterform. The problem I'm having is on the slaveform I loop through
multiple records and want two values depending on the row they select.

slaveform: x=selected
Radio ID Location
x 1 1
2 2
3 3
.
.
.

So in the slaveform I want the ID=1 and Location=1 passed back to the
masterform. Since the row has been selected by selecting the radio
button. I'm using ASP to loop through the records of the database if
this makes any difference.

I would really appreciate an example or suggestions if you guys have
any.

Thanks !


Jul 23 '05 #2
Hey Vincent,

Thanks so much for helping me out with this. I have the general idea
now of what you're suggesting. I am unclear how I should write the
returnedValues function on the parent document.

Could you give me just a little more direction ? Thanks !

Chad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
Sure

Could you give me just a little more direction ? Thanks !


returnedValue is a function you can write yourself. I just thought it
was a good name, but you can name it 'monkey' if you like. You could
process the values in the following manner. Depending on what you want,
you could do anything else with it. This would be a possible implementation
<script language="JavaSCript">
<!--
function returnedValue(id, location) {

f = document.myForm;
f.id.value = id;
f.location.value = location;
}
<!-- -->
[...]
<FORM NAME="myForm" [...]>
[...]
<INPUT TYPE="hidden" name="id">
Location: <INPUT TYPE="text" name="location">
[...]
</FORM>

I hope it helps,
Vincent

Jul 23 '05 #4
Oh, I forgot, naming a name="id" might go wrong, since ID is usually
already an existent properties of an object. You might better call it
'theId' or something. And I made a typo in the method name. There should
be an s at the end of function returnedValues(id, location);

Vincent van Beveren wrote:
Sure

Could you give me just a little more direction ? Thanks !


returnedValue is a function you can write yourself. I just thought it
was a good name, but you can name it 'monkey' if you like. You could
process the values in the following manner. Depending on what you want,
you could do anything else with it. This would be a possible implementation
<script language="JavaSCript">
<!--
function returnedValue(id, location) {

f = document.myForm;
f.id.value = id;
f.location.value = location;
}
<!-- -->
[...]
<FORM NAME="myForm" [...]>
[...]
<INPUT TYPE="hidden" name="id">
Location: <INPUT TYPE="text" name="location">
[...]
</FORM>

I hope it helps,
Vincent


Jul 23 '05 #5

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

Similar topics

4
by: Roy Smith | last post by:
In the recent "transforming a list into a string" thread, we've been discussing the fact that list.pop() is O(1), but list.pop(0) is O(n). I decided to do a little timing experiment. To be sure,...
6
by: Will | last post by:
Hi, Sorry to be a pest... But I can figure this out. I'm pushing to a stack. then I need to check to see if the word is a palindrome. Is the code below correct? if so, how can I check the...
2
by: John Hoge | last post by:
I would like to open an exit pop when a user leaves my site, but I don't want to the back button to trigger the pop if the user remains in my site. I'm using the onUnload attribute of the Body...
15
by: Stig Brautaset | last post by:
Hi group, I'm playing with a little generic linked list/stack library, and have a little problem with the interface of the pop() function. If I used a struct like this it would be simple: ...
11
by: Vijay Kumar R Zanvar | last post by:
> In <pan.2004.04.22.04.06.05.969827@bar.net> "Mac" <foo@bar.net> writes: > > >Is it legal to declare errno after you've included errno.h? > > > >For example: > > > >#include<errno.h> > > >...
25
by: Nicholas Parsons | last post by:
Howdy Folks, I was just playing around in IDLE at the interactive prompt and typed in dir({}) for the fun of it. I was quite surprised to see a pop method defined there. I mean is that a...
7
by: Scott | last post by:
As said before I'm new to programming, and I need in depth explaination to understand everything the way I want to know it, call it a personality quirk ;p. With pop() you remove the last element...
4
by: j_depp_99 | last post by:
The program below fails on execution and I think the error is in my pop function but it all looks correct.Also could someone check my code as to why my print function is not working? I havent...
20
by: merrittr | last post by:
I need some C advice I want to read in string commands from a user when the user enters a \n I want to push it on the stac. Then at some point , if the user enters the word print pop off and print...
1
by: pbd22 | last post by:
Hi all. I am using styles to lock down the GUI until the user enters some info in a CSS/DIV pop box. If the user does now scroll before he clicks, the pop box is centered and the background...
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:
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
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,...
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
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...
0
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,...

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.