Sending A Variable To Another Page

May 17, 2004

I have a page with a form that a user completed. When they hit submit this calls some javascript. This javascript stores some XML in a variable and inserts the values from the form into the correct parts of the XML.

What I need to do is submit this XML or variable to another page. in effect, the use ris submitting the form to generate some XML then i want to send this XML to another page.

here is the code I have so far:

PHP Code:

<html>
<head>
<script>
function thename(){
var username = form1.username.value;
var password = form1.password.value;
var phone = form1.phone.value;

theXML = "<?xml version="1.0"?>
<novo-xml>
<register>
<client-id>test</client-id>
<password>" + username + "</password>

<user-id>" + password + "</user-id>
<phone-num>" + phone + "</phone-num>
<app-id>test</app-id>
<channel>I</channel>
<user-type>upgrade</user-type>
</register>
</novo-xml>";

//I was using this alert to display the XML
//alert(theXML);

}
</script>
</head>
<body>
<form name="form1" onsubmit="thename();">
username <input name="username"><p>
password <input name="password"><p>
phone <input name="phone"><p>
<input type="submit" name="submit">
</form>
</body>
</html>

View 9 Replies


ADVERTISEMENT

Sending Variable To Page From IFrame?

Jul 24, 2011

I'm trying to make a cross domain iframe and want the iframe to dynamic resize the height. I have read that this is not possible, but if I own both domains I thought that I in my cross domian could make an variable which tells the height of the page and then send it via the iFrame to my page. My crossdomain page has a javasacript like this:

Code JavaScript:
var pageHeight = document.getElementById("container").clientHeight;

And my page would get the page like this:

Code HTML4Strict:
<iframe src="mypage.com" width="100%" height="The height from my crossdomain" frameborder="0" scrolling="no">

View 1 Replies View Related

Sending Variable To Php ?

Jan 10, 2005

I'm using a js menu like this:

slideMenu.makeMenu('top','OKP')
slideMenu.makeMenu('sub','Level A','../OKP/KlassementOKP.php?level=A','mainFrame')
slideMenu.makeMenu('sub','Level B','../OKP/KlassementOKP.php?level=B','mainFrame')

As you can see I send the variable level=A to php on next page. What I would like is send another variable for the TOP item: OKP How should I do that ?

View 2 Replies View Related

Sending Dynamic Created Variable In Ext Js

Mar 2, 2009

I am using ext js library to built ajax base site.I need to build dynamci variable and then send that variable with same name in paramter to php i have following function where first i check the array length and then loop untill the array lenght come to end and within that i get the value from html.now i want to send dynamic variables as parameter but i can do this

[Code]...

View 1 Replies View Related

Sending A Variable To A Js Function - Not Working

Nov 18, 2010

I've been fighting this one for a few months now, and it is causing me to have to create multiple functions that basically do the same thing. I am using the three functions below to replace text between two div tags on a page, based on a link that is clicked:

<td><a href="javascript:void(0)" onclick="htmlData('ajax/loginContent.php', 'view=1','data=2','displayField=txtResult')">Active Jobs</a></td>
";

Then further down the page:

<div id="txtResult">replace this content</div>

For some reason, I CANNOT send the div id name as a js variable. When I do it errors out. BUT if I replace displayField in the js functions below with "txtResult" it works fine.

function GetXmlHttpObject(handler) {
var objXMLHttp=null
if (window.XMLHttpRequest)
{

[Code].....

View 6 Replies View Related

JQuery :: Sending The JS Variable Thought The Ajax?

Feb 7, 2011

Im trying to send JS variable thought the jQuery Ajax,The problem is that the php page recive only null ....

My code below:

Code:

$(document).ready(function(){
$('#start').click(function(){
$('#text').html($('#file').val());
$('#response').css('display','block');

[code]....

View 3 Replies View Related

Sending Jscript Client Side Variable To Asp File

Sep 6, 2005

I have an html page, with jscript inside. some variables, some of them
multidimensional arrays. i need to send this information, which can be
changed by the user, to an asp file. the only way i could think of, is
putting it inside hidden box and sending the form. is there any more
elegant way?

View 6 Replies View Related

Sending Time Counter To Next Page?

Dec 20, 2010

User gets for every minute staying on the site 1 credit. Credit is updated each minute, even if the page is not reloaded. But also if the page is reloaded or user continue browsing to other pages inside our site, counter should continue where it stayed in the previous page. If the user leaves the site it doesn't need to continue.

How would you do this? Is it possible to send in javascript value to the next page? Otherwise I have some other ideas, but I am not sure which is the most common: 1. On page leave (if this exists in javascript?) call with ajax timer.php where you assign time to the session. 2. On each 5 seconds call with ajax timer.php where you assign time to the session. 3. Do sql call for each 5 seconds. I guess this is not ok because it is too wasting.

View 6 Replies View Related

Sending Page As XML Lets OffsetWIdth Return 0

Nov 1, 2006

When use text/html as header for my page the method
element.offsetWIdth/Height work as usually and return the real
width/height of an element, but when I use XML as type (which is
necessary in modern browsers to use strict XHTML) the function returns
just 0.

Can somebody help me, it's very important. The prototype function
Element.getDimensions() doesn't work in strict mode.

View 2 Replies View Related

Safari Not Sending Requests During The Onclick Event Due To New Page Load?

Jul 7, 2010

I have a site which displays a selection of advert listings. We log the number of clicks each advert receives via ajax requests.The listings link to both internal pages on our site and external pages, hence the ajax - we cannot log the'clicks' by logging the requests on the destination pages as these are not all on our site for us to log. Also, I don't want to potentially get false positives e.g.from bookmarked pages - hence I am logging the actual clicks, not the requests on the destination.

All is OK in most browsers, but there is a problem with Safari (I am running Safari 4.0 on Windows XP running in Virtualbox OSE) but only where the destination is to open in the same window/tab (some listings go to a new window, some don't). I am logging clicks via an ajax request in the onclick event, which is working fine when the listing is to open in a new window, but it appears that when a new window is not to be opened, the ajax never gets sent.A have constructed the following minimal test case:

index.html

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" [code].....

Note the line commented '****' in index.html which cancels the action of the link. When this is not commented out, the ajax request is sent correctly. Without it (the desired situation) the ajax request never gets sent. Its as if Safari saves up the ajax requests to do later, but never sends them as the new page cancels all such 'saved up' actions.I am using the Safari web developer tools, but I have also checked this test case by checking the Apache logs. Note that as a test case I don't pretend that it will work in IE, but it should work in standards compliant browsers and has been tested on Firefox 3.6.6 and Opera 10.6. The Apache logs show that logger.txt is being requested, unless it is already in the browser cache.Possible workarounds I've considered, but would prefer to avoid:

On the site in question the only such links that currently open in the same window are internal, so I do have the option of logging safari clicks by logging these requests as opposed to clicks and checking the http referer on the server side. As this is not a very flexible solution as it relies on these specific circumstances, also relies on all other links successfully making a new window, and furthermore relying on http referer could result in false negatives I'd rather find a solution within the javascript.I haven't checked whether an asynchonous request would work, but I don't wish to do this anyway just in case there is ever a server problem that prevents the response coming back (note that for these purposes the response is actually superfluous - we are sending the server a message but don't need anything back). I also want to avoid the delay in sending the user to the destination - there is no point having to wait for a response we don't need.Lastly, and my prefered workaround unless I can find anything better, is to make Safari (only) open all links in a new window anyway.

View 1 Replies View Related

Redirect Script And Modify It So That It Rotates A Banner Image Instead Of Sending The User To Another Page?

Jun 12, 2011

want to take this redirect script and modify it so that it rotates a banner image instead of sending the user to another page. The script works so that if the window is out of focus for 10 seconds, it redirects. The images are defined in an external style sheet so I guess I'll have to move that into the document. Also, I want it to be able to work more than once with multiple images, like if the user opens a new tab, comes back, goes to a different tab, the image should change twice. Here's the script:

<script type="text/javascript">
var xScroll, yScroll, timerPoll, timerRedirect, timerClock;
function initRedirect(){

[code].....

View 3 Replies View Related

Get A Variable From A Remote Page And Define As Variable?

Apr 26, 2011

I have a programing problem that have been around for ages. I have search on google using several expressions and words and after hours of digging i'm still unable to do it.I would like to get a value from a HTML page hosted remotely with an inconstant value. Then define this value and name as a javascript variable and apply or show in my page.P.S. Is there any way to make a domain lookup in javascript? I mean a user enters a domain and the script converts to an ip and shows to the user. If not thanks, probably it can only be done in the server side...

View 6 Replies View Related

Load Web Page To Variable

Aug 13, 2007

I have an url of a webpage. I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?

View 11 Replies View Related

Can't Pass Variable From One Page To Another / Fix This?

Dec 6, 2009

Right now I'm working on a website, and it has a hierarchical menu in the right and im also doing some content loading in a div, all that with javascript. My problem is that when they click on a link, I need to pass a variable "id" through the link. I dont want to pass it in the url, but I want to pass it in another way, for every link the id is going to be different. How can I pass a variable to another page and how can I retrieve it in that page so I can use it for the content loading?

View 1 Replies View Related

Reload Page With Different URL Variable?

Dec 20, 2010

I know I can make a link that reloads a page like this:

<a href="thispage.php">Refresh this page</a>
Or, using javascript:
<a href="javascript:location.reload(true)">Refresh this page</a>

I am starting from "thispage.php", and I want to reload it as "thispage.php?action=newversion"? (This page has a form that reloads the rest of the page with new data when refreshed with the action call).

Is there a javascript technique that would do this without calling the "thispage.php" part? The page includes a function that I need to be portable to any page that I place it on.

Obviously this is very wrong but I am trying to do this:

<a href="javascript:location.reload(true) . ?action=newversion">Refresh this page</a>

View 2 Replies View Related

Keep A Variable Value On Page Refresh?

Apr 18, 2011

Is there a way to keep a variable value on page refresh, if I have

var x=0;

but then a users does somethibng that makes that value become

x=4;

and then the page is refreshed, is there a way to keep that value of 4 for the x variable or it will always reset to the original value?

View 4 Replies View Related

Having A Variable That Depends On The Url Of The Page?

Apr 17, 2011

For example, if the pages are called:

[URL]

I'm trying to put in a "next" and "previous" page function, but i want the code on every page to be the same because I'm using the same PHP include on every page. I want to use the number (last directory) in the URL as my variable, so that even with the same javascript on every page, every page will have a different variable so that the "next" and "previous" links can go to the right page.

View 4 Replies View Related

Get The Source Code Of A Page And Contain It In A Variable?

Apr 19, 2009

Is there a function in javascript to get the source code of a page and contain it in a variable, or automatically obtain information from it in some way?For example, if I needed to get the title of a certain page, would I be able to somehow implement document.title to get the title of a webpage?

View 4 Replies View Related

Url Variable To Onclick - Can't Get The Next Page To Load

Sep 22, 2009

I am trying to use an onclick statement to go to an alternate web page displaying a different version of tha file being displayed in the current page.

In the HEAD section of the current page I have a global variable named currentfile that contains a file name. This function is also in the HEAD section immediately below the variable's declaration

I have tried every combination I can think of in the onclick code to get it to work but, no joy. here is an example:

I just can't get the next page to load.

View 15 Replies View Related

Adding A Variable To Url When Page Loads -only Once!

Mar 8, 2006

This is for an ASP submission form. User creates a record, Access assigns a unique ID by Autonumber, I want to then pull that ID and insert into URL.

This is my code:

var addID
addID = '<%=(rsResults.Fields.Item("ID").Value)%>'

location.href=('?ID='+addID);

It adds the ID to my url fine, but it doesn't stop!
I've tried making a loop by this method:

var addID, looper;
looper=1;
while (looper < 2) {
addID = '<%=(rsTestResults.Fields.Item("ID").Value)%>'
looper=2;
location.href='results.asp?ID='+addID;

}

View 1 Replies View Related

JQuery :: Pass Variable To Another Page?

Aug 28, 2010

Code:
$(function() {
$("#slider").slider({
value:0,
min:0,
max: 10,
step: 1,
[Code]...

Question 1: How can i transfer the slider value to another page?

Question 2: I am using the price value in the slider from my previous page using the [VarName,S] variable. It shows the first time price value successfully as it brought from the previous page but once I slide forward and than slide back the value initiated to 0 instead of the value i carried from the previous page. How can I retain the min price value to the value i carried from the previous page?

View 1 Replies View Related

Pass The Value Of <SCRIPT SRC= To Page In A Variable?

Nov 25, 2002

I want to pass the value of my <SCRIPT SRC= to my page in a variable e.g.

<script language="javascript">
if (location.search) {
var parmsrc = location.search.substring(1);
}

[Code].....

However, it is not working. Can this be done? I could not find it documented anywhere.

View 6 Replies View Related

Storing Page Source As A Variable?

Mar 26, 2010

I need to write a script that parses a web page for a given delimiter and then stores the following 50 characters as a variable. I wrote the following php script:

Code:
<?php
$del = "picture_id";
$url = "http://xxxx.net/xxxxx/xxxxxx.php?do=xxxx";
$source = file_get_contents($url);

[Code]....

The delimiter is always going to be constant, however the succeeding characters will be different each and every time. I need to write this in Javascript because it is hosted on my server, and ran by users who post on my brothers message board (which is hosted elsewhere). Since Php is server side I always get "guest" as a value rather than the random string of characters like it should be.

View 2 Replies View Related

Change Js Variable By Page Title?

May 26, 2011

I need to be able to change the variable in this line d.addBusDays(3); from the code below, based on the page title.

For example. Page Title 1 = 3 .... Page Title 2 = 6 .... Page Title 3 = 12

<p align="center"><br><b>Est. Shipping Date:</b><br> <br>

View 11 Replies View Related

Retain Variable Across Scripts On The Same Page?

Oct 8, 2009

I'm using a plugin in Wordpress that checks for mobile browsers and sets a variable to "true" if a mobile browser is being used. I have a script I want to use on the same page where I'd like to use that variable rather than have to redo the check again. Is it possible to make a variable in one script global so that it can be used in a separate script on the same page? Greatly simplified, I mean ...

<script type="text/javascript">
var A = 1;
</script>
<script type="text/javascript">
Do something with A;
</script>

View 11 Replies View Related

Set A Page Element As Variable And Change It?

Apr 29, 2010

How do i set a page element as a variable and change it?

Ive googled the internet like crazy for an answer for this, but couldnt find it. Im trying to create an animation. My question is, how do i change the width of a div onclick?

Essentially, I want it to add one percent of the value of the width of the div every one second.[code]...

View 3 Replies View Related







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