Passing Value From Child Form To Parent Form

Dec 13, 2011

i'm newbie in javascript fucntion. here i got problem to passing the value from child popup form to parent form. here my code

parent form
<script language="JavaScript">
function selectItem(){
var selindex=document.myForm.myselect.selectedIndex;
if (selindex!=0) {
document.myForm.item_desc.value=myArray[1];
document.myForm.item_code.value=myArray[0];
}
}
</script>
[Code]....

View 2 Replies


ADVERTISEMENT

Passing Data From Multi-page Child Form To Parent Form

May 23, 2010

I would like to have a main form (written in PHP) that has a "lookup" button next to a text field. When the user clicks "lookup", it should open a new window that lets them search (child.page1). When they enter a name or DOB into the search form, it submits the form through PHP (via POST), to a results page (child.page2). This displays all persons in the database which have a name or DOB == to the search term(s), with a checkbox next to each match. They click the checkbox (or alternenatively, a link), and return the checkbox value to the main window.

I have everything working right now, except that (child.page2) doesn't recognize the main window. If the data is entered on (child.page1), it works fine. I'm not very familiar with javascript.. is this even possible? I've considered using frames, to keep the parent-child relationship evident to the computer, but figured I'd check to see if there's an easier way.

View 4 Replies View Related

Child(iframe) / Parent Form - Administration Console To Upload Images With PHP

Jul 14, 2010

I am working on a form inside my administration console to upload images with PHP. In my form I have the following:

[Code]...

The onchange submits the form to a seperate PHP file (sent in the action of the form) dedicated to handling the uploading of the images, while the submit button(not shown in code) will submit the rest of the form through ajax. In order to use 1 file field, Ive read that to get an ajax looking effect I need to use an iframe, so I added the IFrame into the HTML and got the effect working right (without actually uploading the files.)

Now I want to limit the ammount of images to 8. Which is where the hidden field came in. So i've got to figure out a way to count the successful uploads, or add them as we go. At which time that number turns to 8, the script will disable the file field from anymore uploads. Problem is I have no clue where I need to go within my php file to make this happen. Here is my php file with javascript added in:

Code:
<?php
// lets go ahead and get this image uploaded
?>
<script language="JavaScript" type="text/javascript">
var parDoc = window.parent.document;
var upldcnt = parDoc.getElementByID('upload_cnt').value;
[Code]....

View 1 Replies View Related

Child And Parent Passing Values

Mar 23, 2006

I have a parent page who allows user to view an invoice for service. My page bases the date and the value for payment to <%now%> and to <%total_price%>.
However I'd like to permit for users to editing those two fields by opeing a popup window with a new form and asking for these two new inputs. Afterward off corse, this values need to populate the equivalent fields on the parent page.

My questions:
1)I'm opening the new window after a js confirm instead of href or onclick methods, so I don't know how to pass the parent variable ID to the child window..

The code:
if (confirmation) {return true;}else{popupwindow("invoice_editing.asp?ID="id"");}

Problem:
the parentID=request.querystring ("ID") don't work

2)My child window picks the new values from the form... but I don know how to pass back the new values to the parent page and then reload it..

Please, but as much specific as you can to my problems and also please put the whole code of proposed solution, since I'm totally lost.

View 3 Replies View Related

Passing Value From Parent To Child Window Created By Pop Up

Dec 5, 2006

Passing value from parent to child window created by Pop up.

View 2 Replies View Related

Passing Data From Parent To Child Window

Sep 28, 2006

I am trying to pass user data from a parent window to a child window. I read somewhere that if i want to pass data as soon as child window opens i need to add a pause for the form elements to load. I am using the code snippet below.objf.form_parent.text1 is a text field in the parent window and newWindow.document.test.text1. is a field in child window. Can anyone help what I am doing wrong. Code:

View 2 Replies View Related

Passing Properties From Parent Window To Child?

May 25, 2010

In javascript I need to pass a variable or function or something from the parent window to the child window. There will be a URL in the parent that needs to be passed into the child so when you click on the link in the child window it pulls in the link from the parent's js. Like this (ignore my rubbish javascript as I'm just writing it to explain my point!)...

Parent window var variableName="http://www.google.com" (send variable to child window)

Child window (pick up variable from parent window and drop it into the link's URL)
<a href="(variableName);">google</a>

This might seem like a crazy way of doing things but it's totally neccasery in the project I'm working on for various reasons.

Not sure if its a variable it needs but either way it needs to be in the js somewhere in the parent and the child needs to read it within the link. Everywhere I've looked on the internet shows how to do this with forms etc but I can't make it work for a URL.

View 5 Replies View Related

Passing Control From Child To Parent Window?

Mar 12, 2010

I am opening a pop up in a new window (window.open) . I have no control on the code of the pop up. Its a third party pop up (twitter). Now that generates a callback url and I can specify that.My problem is the callback page is loaded on the pop up window. I want that window to close and have the call back page loaded on the parent window.

View 1 Replies View Related

Jquery :: Passing Parameters - Parent / Child Templates

Mar 3, 2010

I have little bizarre problem. Working in Java web development we have project that we use plenty of templates from Velocity. Where one template can refresh section of it self and display one or more templates. My problems is that in parent template I have to pop up window with message if in child template and item from group A been moved to group B or vice-versa. How to change on child template can be propagated up to parent?

View 3 Replies View Related

JQuery :: Create A Hidden Form Field In A Parent Window From Within A Child Window - Popup

Jun 13, 2011

Im trying to create a hidden form field in a parent window from within a child window (popup). I am trying to use jQuery, but unfortunately the hidden field does not get created.

Code JavaScript:

View 2 Replies View Related

Parent Child Checkbox - Only Same Name Of Child And Parents Should Be Unchecked

Oct 28, 2010

I have created parent child checkboxes. When one child is selected, then parent of that child, other child of same name and parent of that same name's child will be selected... Now I want if I unchecked any child, then only same name of child and parents should be unchecked or if I unchecked Parent Child, then same name of parent and child will be unchecked.

[Code]...

View 1 Replies View Related

Form Fields In IFrame Page - Parent Page Get The Form Data Entered?

Oct 14, 2011

I have form input fields but it is being called through iFrame by the page. But how do I get or pass the data entered into the parent page.

[Code]...

View 1 Replies View Related

Why Can't I Access Child Frame Elements With The Direct Form?

Jul 20, 2005

I have a document that contains a child frame with name/id = "help_frame".
From Javascript in the top level document I can access the child frame's
elements using:

var elem = document.frames.help_frame.document.getElementById ("chkSynonym");

but if I try:

var elem = document.frames.help_frame.document.chkSynonym;

the result is 'undefined'. What is wrong with my syntax?

View 1 Replies View Related

IE Does Not Submit Parent Form

Apr 9, 2009

I have a form inside a form. The problem is that IE does not submit the parent form for some reason.

View 3 Replies View Related

Passing Variables To Form?

Jul 8, 2009

I have a javascript function that receives the form name, field name and value and I want to be able to spit that data back to the originating form after doing some processing on the data.

The values are making it to the function perfectly, but when I try to return those values to the form, it tells me it's not a function. I know there's some syntax problem, but I'm just not sure where!

function doThis(one,two,three){
var myFormName = one;
var myFormField = two;
var myFormValue = three;
var goHere = myFormName + '.' + myFormField;

[Code]...

View 4 Replies View Related

Passing The Form Inputs?

Oct 25, 2010

I need to style a checkbox, so I made it into two images behind a form with hidden inputs. On click the form takes input from the other form into the hidden fields and POSTs it. Then I use PHP to grab that POST and put it back into the original form.Here are some snippets of what I am trying to do:

First form input:

<input type="text" name="email" id="email1" value="<?php if(isset($_POST['email2'])) { echo $_POST['email2']; } ?>" style="height:25px;width:270px;" />

Second form input:

<input type="hidden" name="email2" id="email2" />

Second form submit image button:

<input type="image" src="img/Boxchecked.jpg" value="submit" onclick="fname2.value = fname1.value; lname2.value = lname1.value; email2.value = email1.value" width="20" height="20" />

The forms work fantastic on everything but IE, which does not save the field values. How do I fix the onclick event to save them in IE?

View 1 Replies View Related

Passing Data In Form?

Jan 22, 2009

I have a search form with 3 fields. What i'm trying to do is make it to where when a user clicks submit it sends the data from 2 of the fields to 1 hidden field. (don't tell me to change the names and id, I can't) I am looking for any method to make this work. I just can't change the field names.

example:
first two (visible)
keyword = pizza

[code]....

View 2 Replies View Related

Passing HTML Form Value

Jun 6, 2009

My goal: To swap the visibility of two divs via the user defined form value. Thus getting 'Iowa' or whatever school via the form value, not manual declaration. What I have done successfully so far: 'Manually' pass a variable (Iowa) to Javascript, but not automatically via the value of the form. With the manual method, the divs toggle. 'Iowa' shows up, 'Options' goes away. I've tried: Things like 'var college = document.searchfield.value' - to no avail... What I'm using: CSS Globe's 'Searchfield' - autocomplete search form. Also a previously successful Javascript function to manually switch div visibility.

[Code]...

View 2 Replies View Related

Passing JS Variable To Form?

Sep 5, 2011

I'm using the Maxmind Geoip database to pull information about the visitor:MaxMind - GeoIP JavaScript Web Service(namely the city and state).I want to use that information to prepopulate one of the fields on my form (say city)

Code:
<input id="awf_field-24855776city" type="text" class="text" name="custom US Address (City)" tabindex="502" />

Anyone have any idea how I can do this? I tried the document.write function and it doesn't output to my value="" field with the correct data

View 2 Replies View Related

Passing Values In A Form

Jun 25, 2001

I am trying to pass values from a textarea to an input box or vice-versa....
I am using a function to do this with the onClick method in my submit button.

The value is being passed but only for a second and then vanishes.

Any advice on this? Code:

View 3 Replies View Related

Passing Url Value To Form Input?

May 23, 2010

here is my problem :

my example url : [URL]

I need a JavaScript code that can get type , name & id from my example url and pass them to a form input value.

Code:
<form name="myform" >
<input type = "text" name = "type" value = type =111 >
<input type = "text" name = "name" value = name=jack >
<input type = "text" name = "id" value = id=2 >
</form>

i can't change my form input tag properties . i don't have access to it's value notice that i need a java-script code that it don't use a method in input tags and it can change the value of that input.

( i am creating a form using CCK in drupal & i don't want to use views module for some reason)

View 4 Replies View Related

Passing Data Into A Form?

Aug 28, 2010

I am using a variation of this script so that on the homepage of my site, a person can enter their phone number and the data from that form is tranfered onto a form on a second page for the rest of their other data as well as autofilling in their phone number data they entered on the first page.

The output for the code is:

Code:
<SCRIPT LANGUAGE="JavaScript">
areacode = unescape(params["areacode"]);
document.write("areacode = " + areacode + "<br>");
</script>

[Code].....

View 10 Replies View Related

Setting Values On Parent Form

Feb 14, 2007

I know how to reload the mainform, but accessing a form and setting a
value there?

onLoad="if (window.opener && !window.opener.closed)
{ window.opener.forms[0].elements[0].value='xxx'window.close(); }"><?

View 1 Replies View Related

Submitting Parent Form From IFrame?

Apr 19, 2010

What line of javascript can I use to submit a form that's inside an iFrame?Here are a couple of failed attempts:document.getElementById('captcha_iframe').forms['reserve_booth_space'].submit();window.frames['captcha_iframe'].forms['reserve_booth_space'].submit();

View 4 Replies View Related

JQuery :: Ajax At Passing The Value Of Form?

Jul 7, 2009

I'm working on a generator that is supposed to do something after something is selected from forms. So here it goes: I got two select forms now. After I select the value from the first form the value of the form is passed to the second form and it then generates it's own values depending on the value it gain. I realized that you can do this without page refresh with JQuery and I thought that would be nice and I gave it a try but now I'm stuck and here is my problem:

I've problem at passing the right value from the first form. I only want the value of the option that is selected. All my values are coming from MySQL database. I've tried this: var str = $('#customer').val(); (customer being the id of my select tag of the form) but it just returns an empty array. I don't want to pass array in the first place. I just want to pass the value.

I've tried serialization too but iit passes the right value but it passes it so many times as I have options in my form.

[Code]...

View 4 Replies View Related

Passing Form Variable Into Script?

Jul 9, 2009

I have combined a user's input with a Craigslist RSS Url in this form:Craigslist RSS URL (missing 1 number to define bedrooms) + User Input Number (this completes the URL)Here is the code:

<form name="test">
<script language="Javascript"><!--
rss1 = "http://losangeles.craigslist.org/search/hhh/sfv?query=2br&minAsk=min&maxAsk=max&bedrooms=";

[code]....

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved