Passing Variables To A Pop-up Page Function?

May 24, 2010

I want a page with a hyperlink that passes a variable to another 'pop-up' page (in this case a name, its just an example) and new pop-up page prints a message followed by the variable thats passed.

Here is the code as it is right now

<html>
<head>
<script language="javascript" type="text/javascript">
function popitup(a)

[Code]....

In short, I just want the pop-up page to print 'Hello there Toby' or whatever name I choose to pass across. The 'testpopup.html' url is just the initial webpage.

View 2 Replies


ADVERTISEMENT

Passing Variables Into A Function From A Form

Jan 3, 2011

I have a vague idea of what might be going wrong but I have no idea what I should be doing instead. Here is what I'm trying to do: User inputs X and Y coordinates into form validate that they are numbers do a little bit of maths redirect to a php script with a single variable tacked onto the end of the url Here is the form code:

//part of a larger php script to make the form
echo "<form name='gotoForm' onsubmit='return coordCalc()'>
<fieldset>
<legend>Go to Square</legend>
X <input type='text' id='X' size='1' maxlength='3'/>
Y <input type='text' id='Y' size='1' maxlength='3'/>
<input type='submit'
[Code]...

View 7 Replies View Related

Passing Variables From One Page To Another?

Jun 10, 2011

I want to pass 2 variables from a html page and collecting in another html page using javascript. Say I pass xyz and abc to a page 2.html from 1.html without using cookies. In 1.html page i have many links. each link should be able to pass different variable to 2.html. When some one clicks on a link the variables should be passed to 2.html. I want to know how to collect them and use them.

View 4 Replies View Related

JQuery :: Passing Global Variables To Function?

Feb 8, 2010

i have this problem in passing values to a variable in a jquery function.

i have a js variable that accepts a certain value and then i want to pass this variable in the jquery function.

For example, this is my script:
var autoScrollBool = "true"
var autoScroolInt = "10" (seconds)
stepcarousel.setup({

[Code].....

i want to replace the value of autostep: {enable:true to enable: utoScrollBool(the variable i created) , when i tried to assign it as is, its not working.

View 1 Replies View Related

JQuery :: Passing Variables Into An Inline Function?

Jul 16, 2010

I am trying to use jQuery to populate a number of divs with html from external blog pages:
for(var i = 1;i<=3;i++){

[Code]...

I understand that the 'i' variable is out of the scope of the inline function but I really don't know any other way of doing this.

View 3 Replies View Related

Passing PHP Variables To A Function Multiple Times?

Sep 3, 2011

First off I didn't know whether to post this here or in the PHP section since it deals with both, but mostly JS. I have a PHP scraper that scrapes the job title, company name and location from a website and stores them in separate arrays. These values are then extracted out one at a time from the array and stored into a string, that is then passed to a Google Maps API.

I can make this successfully happen once, the thing is I need to do it multiple times. I have an idea on what I should do but don't really know how to implement it (correctly). The idea I had was to create a function in the JavaScript section that accepts three values from PHP. This function would be called in my PHP for loop that extracts the values from the array into a string. The thing that confuses me is that the Map function is called via <body onLoad="initialize()">. Here's the link to my code (http://pastebin.com/rTfzJM16)

View 1 Replies View Related

Passing Variables To An Onclick Assigned Function?

Mar 11, 2011

I'm looking for some help, as I've been going crazy trying to wrap my head around the step I am missing here. I have a function that generates a table of predefined row/column size, and which sets each <td> element's ID to "x ,y" where x and y are the horizontal/vertical coordinates within the table. It's intended for use in running a simple game.What I'd like to do is take it one step further and have the script generate onclick assignments for each <td>, giving them all an onclick function with unique arguments defining the <td>'s grid location. My problem is that I can't figure out how to pass the variables defining the coordinates to the onclick function created in the loop, as an argument.The syntax I'm using for assigning the onclick function:PHP Code:

cell[countx].onclick = function() {clickTile(''+countx+','+county+'')};
Variables countx and county are local to the original function. Here it is in context:
PHP Code:

[code]....

View 6 Replies View Related

JQuery :: Reload A Page With Ajax In 5 Seconds Passing GET Variables?

Oct 7, 2011

I'm reloading a div of a page using jQuery, but i need that every time that reloads (it reloads automatically every 10 seconds) obtains the get variables that i passed through the address bar

View 4 Replies View Related

Passing Variable From External Function To Php Page?

Dec 15, 2009

I have a function in an external javascript file (calculate.js) which calculates the price of a product, based on a users preferences in a form (dropdowns, radio buttons etc). Each time the user modifies their choice, the script/function then displays the price on the page (index.html) using:

document.getElementById("price").innerHTML = price;

Once the user has finished making their choices, they then click the forms submit button (method="post") to be taken to a confirmation page (confirm.php).

Here, I can display the users preferences using php code like:

<?php echo $_POST['size'] ?>
<?php echo $_POST['color'] ?> etc, etc...

But I'm not sure how to pass the price over!

The preferences come from the form and are picked up with php. But the price is calculated with javascript! How do I send it to confirm.php?

I have tried adding

window.location = "confirm.php?Quote=" + price;

to the function, but this changes the page before the user may want to go to the confirmation page!

Can I add a hidden input to index.html with the value set as the javascript variable called price? If so, what syntax do I use for this? I have tried

document.write('<input type="hidden" name="quote" value="'price'" ?>" />')

and some other stuff too, but I still can't get it to work!

Or do I pass the value in the url, like confirm.php?Quote='price'? Again, what is the syntax, as I can't seem to get it to work?

View 4 Replies View Related

Passing Variables To PHP

Mar 21, 2005

For some reason, I am using document.referrer in a PHP script that is called as a JavaScript script. The problem is that I need to pass the value of document.referrer to a PHP variable (in the same file) in order to add it to the database. How can I do that?

View 2 Replies View Related

Passing Javascript Variables To JSP

Jul 23, 2005

I need to pass a javascript to JSP code but I cannot figure it out.

View 2 Replies View Related

JQuery :: Passing Variables Into JQ?

Oct 1, 2009

This probably seems pretty trivial to you experts but I just don't know why it doesn't work and would like a nudge in the right direction please.I have a sllide and fade that works great - no problems. I am firing it with a function call from the HTML like so;<a href='#' onClick='sfade('#s1'); return false;>as you see I am passing the div to be faded(and slid) as a variable. Works great. The receiving function is:

var str='';
function sfade(str){
$(str).slideFadeToggle(1000);

[code]....

View 5 Replies View Related

Passing Dynamic PHP Variables?

Jul 16, 2011

I'm creating dynamic buttons and forms for a website and would like the form hidden when it's corresponding button is clicked. However, when I pass button and form name variables to my JavaScript that hides the form, the variables are not being recognised unless I explicitly set them. (e.g 1 and 2 as seen below).

In a nutshell the onlick event doesn't seem to like PHP variables !

[Code]...

View 1 Replies View Related

Passing Variables With OnClick?

Jul 8, 2009

Don't know if this should be under JS or PHP... I have 2 different pages. On the first one, a table shows a list of items. Each has a button that when clicked opens another window with specific size attributes, hence the onClick event. The 2 PHP variables are computed and different for each item (each line).

Here is the line:

<input onClick="javascript:window.open('player_buy.php?send_role=<?=$data['ROLE']?>&send_price=<?=$send_price?>', '_blank', 'status=0,toolbar=0,scrollbars=0,location=no,statusbar=0,menubar=0,resizable=0,width=739,height=320, top=0,left=0')" class="button_sale" type="submit" value="> > >" name="submit">

Now of course, on the popup window, the URL will show .../player_buy.php?send_role=XXX&send_price=XXX

But the goal is to avoid that. So my question is: Is there a way to open such a popup window, pass these variables to it but in a way that it would not show in the URL?

View 6 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 Variables In And Out Of Functions

Nov 3, 2010

To formulate the problem simple i have two buttons with the onclick function:

I guess what im asking is how can you set a variable by one onclick function and then use it in any other function?

View 1 Replies View Related

Passing Variables Actively

Apr 4, 2006

I have one page witih PHP where users will be answering a form for file upload. However, I need to give them the option to either upload a file or select one that is already uploaded.

In order for them to select a file that is already uploaded, they will use a pop up window to browse to the file and and select the a file with a radio button or submit button to select the file.

What i need to happen is when they press "select" they window needs to close and that file's url or relative path needs to fill in the "select uploaded file" with the path or url.

I"ll be using PHP in both form and popup for the file, but I cant do that with php without refreshing the page. Can javascript do this and how would I go about this.

View 2 Replies View Related

Javascript Passing Variables To App

Jul 16, 2006

A while back I was working on learning C++. However after finding out that making API's was too difficult I switched over to HTML and Javascript for a while to get it to do what I want without having to fry my brain on weird code statements.

Well now I've reached the barrier of being able to save data. For a while I've just had it to the point where the code I need is saved in a textarea and I copy and paste it in notepad. Then upon reentering I pull it out of Notepad and paste into the testarea.

Well enough with the bla bla bla. Is there a way I can use the <form method="post"> stuff to pass a variable to a C++ compiled program?

All I need to know is: 1) can I use <form method="post" action="SomeProg.exe"> and 2) what would the name of the posted variable be to use in my C++ code? As you can tell I running client-side so PHP and other server-side languages that WinXP don't support without special installation wont work.

View 2 Replies View Related

Passing PHP Session Variables ?

Jan 21, 2009

How to pass (well more like bridge) session information to the client side from server side.

Right now, what I'm basically doing is echoing the userID and the username into a method in JavaScript tag at the bottom of every page.

The reason why I am doing this is simply for AJAX-related interactivity.

This is an example of what the code looks like:

Code:

A) It requires JavaScript code to be pasted within the HTML document (its non-external).

B) It requires the code to be echoed in EVERY PAGE.

C) A PHP Script or Class must maintain the responsibility of printing the session values.

D) The variable data cannot be accessed from any imported javascript files prior to where it was printed.

Now, I'm wondering about using Cookies. This would benefit me since I don't have to inject any ugly javascript code into the HTML output. I can also remove the PHP script that echoes the values and the changes will be purely handled in PHP (cookies can be updated!).

The only issue that's stopping me is simply security. Since cookies can be edited very easily on the client side, then the data can be changed. But then again so can the JavaScript (using a tool like Grease Monkey).

Once again, I am aware to never ever to trust the client side data without any validation; therefore using some sort of hash checksum, the cookie data can be compared to its PHP equivalents.

View 3 Replies View Related

Passing PHP Variables Not Working ?

Aug 11, 2010

I've been workling seperately with PHP/ MySQL and am now trying to get things together with jQuery which I have so far only used with non-dynamic content. Here is the setting I am trying to achieve:

I have one php file that generates two different contents depending on the setting of a status-variable $ncs. If $nsc=0 the main page is loaded, showing an overview of all available news-articles. If $ncs=1 the content of a specific article is shown fully. The jQuery connected to each case differs. So i would like to pass the varible $ncs over to my jQuery script:

Code JavaScript:

I have checked that $ncs is not NULL on the rendered page. However after being passed to the jQuery script the variable is undefined. I have never connected PHP and jQuery so it is probably a general twist in my idea of how it works. I tried passing different variables and all are undefined in jQuery. What do I have to attend to when passing PHP-variables to jQuery?

View 3 Replies View Related

Passing Multiple Variables Via Url

Sep 12, 2003

I'm trying to pass multiple variables using a url on a Java function call.
the code I have that passes the 1 variable is:

function HandleChange() {
parent.CustomerIf.document.location.href="CustomerReturn.asp?id=" + varName.options[varName.selectedIndex].text;
}

which passes the chosen data (being loaded from a database) from a drop down box on an onchange event in asp script.

What I want to do is pass multiple variable via the above url script that the next page will get by the request.querystring method.

something like this:

function HandleChange() {
parent.CustomerIf.document.location.href="CustomerReturn.asp?id=" + varName.options[varName.selectedIndex].text + "address=" varAddress.value;
}

View 4 Replies View Related

Passing Variables Between Web Pages

Jan 19, 2004

I am attempting to display info put into an array from an onClick() event in a different page - I have created different functions which populate an array with different info dependant on which link the visitor clicks ie HTML Code:

<a href="nextpage.htm" onClick="functiontopopulatearray()"> SELECT</a>

The function seems to work fine, however when the next page loads and I attempt to access the array elements they are now undefined - both pages are linked to the same JS document.

View 2 Replies View Related

Passing Variables Between Two Windows

May 24, 2004

Basically, I have a window with an empty text field in. When I click on a link, another window appears on top of the first. (A pop up window.)

The popup window also has a text field in it. If I type "Test" in the popup window's text field and click "Submit", is there a way I can send that value to the empty text field in the first window?

View 2 Replies View Related

Passing Variables From One Window To Another

Apr 18, 2005

We have a content management system that requires us to fill in 20 fields for metadata about a page. We store the metadata in a separate database for our records.

I'd like to be able to open a window with the data from our database, click a link, and have it fill in the form in the content management system (hosted by a different organization, so window.opener is out of the equation).

I tried this

<a href="#" onClick="window.open('http://www.google.com', 'Google'); window.Google.f.q.text.value='my name'">Enter my name in Google!</a>

In this example, I'd click a link that would open up Google, then pass the value "my name" to Google's search bar. Unfortunately for me, it didn't work.

Am I asking too much? I'd hate to have to rekey or copy/paste 20 fields worth of metadata each time I create a page.

View 6 Replies View Related

Passing Variables To Php Thru $_post??

Mar 18, 2007

At the moment I have this function, which passes variables to a php file with $_get

function savePath() {
//store title
pathTitle = 'pathTitle=' + document.getElementById("pathTitle").value;
//pathLength = getPathLength();
window.location.href = "save-path2.php?"+pathTitle;
}

but I need to use $_post

function savePath() {
//store title so we can use $_post
pathTitle = 'pathTitle=' + document.getElementById("pathTitle").value;

data = '<form action="save-path2.php" name="formData" method="post">
<input type="hidden" name="pathTitle" value="'+pathTitle+'" />
</form>'
document.formData.submit();
}

How would i automaticly submit the form?

View 1 Replies View Related

Passing/processing URL Variables

Aug 21, 2000

I forget how to parse the variables passed on the URL like this:

<A HREF="http://www.mysite.com?bla="blahhh"" TARGET=_blank>http://www.mysite.com?bla="blahhh"</A>

How would I check this for a value and add some code to a page if it is equal to this value?

View 2 Replies View Related







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