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

Form move variables

Hello to all

I have a form in a php script with some inputs.

With this form I like te send a javascript variable to the
next php script.
Every Input are transmittet to the next value but the
caddie value will not be send!
I used the following command in the javascript area:
document.form1.caddie.value = commande;
I don't have a input on caddie!

Many thanks in advance for your help.

Regards

Otto
A view of the two scripts:

Php script 1
************
..
<FORM NAME="form1" onSubmit="return form_validator(this)"
ACTION="order_final.php" METHOD=post>

<SCRIPT language="JavaScript"><!-- //script hider
var commande = ""

function form_validator(theForm)
...
...
// send value commande with the form
document.form1.caddie.value = commande;
...
Return (true);
}
</SCRIPT>
...
<INPUT TYPE=text NAME="email" VALUE="" SIZE=40>
...
<INPUT TYPE=submit NAME=Submit VALUE="<?php echo
$txt_send_order ?>" >
...
</FONT>
...

Php script 2:
*************
<?php
$no_comm = date("ymjHis");

// required variables
require("config.php");

$message ="IP: $REMOTE_ADDR Host: $REMOTE_HOST

Commande No.: $no_comm

$email
$company
$name
$caddie

Total $txt_currency: $total
";

mail("$receipt,$email", "Re: Online Order", "$message",
"From:$receipt");
?>

Jul 20 '05 #1
4 1473
In article <VA******************@freesurf.ch>, Otto Haldi <oh****@freesurf.ch>
writes:
With this form I like te send a javascript variable to the
next php script.
Every Input are transmittet to the next value but the
caddie value will not be send!
I used the following command in the javascript area:
document.form1.caddie.value = commande;
I don't have a input on caddie!


With the form code you gave, it should throw an error (javascript error) since
caddie doesn't exist in the code you gave. Create an input named caddie and
then let PHP retrieve its value.

<input type="text" name="caddie" />

And Return should be return, its case-sensitive (at the end of your js
function)
--
Randy
Jul 20 '05 #2
Hello Randy,

Many thanks four your quick answer.
With the form code you gave, it should throw an error (javascript error) since
caddie doesn't exist in the code you gave. Create an input named caddie and
then let PHP retrieve its value.

<input type="text" name="caddie" />

And Return should be return, its case-sensitive (at the end of your js
function)


I did exactly what you told me, but still not work!

I also have tried this solution before.
But I don't need to see this input field on the form!..
Regards

Otto

PS: To see the whole php script, I can send you a copy if you like to help me
more!

Jul 20 '05 #3
In article <VA******************@freesurf.ch>, Otto Haldi <oh****@freesurf.ch>
writes:
Hello Randy,

Many thanks four your quick answer.
With the form code you gave, it should throw an error (javascript error)since
caddie doesn't exist in the code you gave. Create an input named caddie and
then let PHP retrieve its value.

<input type="text" name="caddie" />

And Return should be return, its case-sensitive (at the end of your js
function)


I did exactly what you told me, but still not work!


Post a URL to a sample page.
I also have tried this solution before.
But I don't need to see this input field on the form!..


Then make it a hidden input <input type="hidden" name="caddie"....../>

--
Randy
Jul 20 '05 #4
Hello Randy,

Many thanks for your help. Now every think work well I find out my mistake!

Regards and happy new year

Otto

In article <VA******************@freesurf.ch>, Otto Haldi <oh****@freesurf.ch>
writes:
Hello Randy,

Many thanks four your quick answer.
With the form code you gave, it should throw an error (javascript error)

since
caddie doesn't exist in the code you gave. Create an input named caddie and
then let PHP retrieve its value.

<input type="text" name="caddie" />

And Return should be return, its case-sensitive (at the end of your js
function)


I did exactly what you told me, but still not work!


Post a URL to a sample page.
I also have tried this solution before.
But I don't need to see this input field on the form!..


Then make it a hidden input <input type="hidden" name="caddie"....../>

--
Randy

Jul 20 '05 #5

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

Similar topics

2
by: Steve | last post by:
I'm working in PHP, but am also using JavaScript, so perhaps there is a better way to do this using more PHP code...... I setup a search screen for my database, the user enters data and submits...
2
by: Mark Hannon | last post by:
I am trying to wrap my brain around storing form elements inside variables & arrays before I move on to a more complicated project. I created this simple example to experiment and as far as I can...
8
by: Sergio Otoya | last post by:
Hi all, I need to add an input hidden field to an existing form (post). I have tried a couple things like adding the '<INPUT type=hidden name=idSelectedURL value=http://server/documents>' to...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
4
by: Tony W | last post by:
Hi, I am trying to write a simple application to retrieve data from the Windows registry and insert it into textboxs on a windows form. So far I have one namespace containing two classess. ...
0
by: Craig | last post by:
Hello, I have a web form that allows the user to move a unit on a manufacturing router. The user click one of five buttons which each represent a step on the router. When the user clicks any...
1
by: zoneal | last post by:
Making this as simple sounding as I can. I already have a form that generates an xml file. I could go 2 ways with it: cycle through the variables and move them as an array through the web service...
5
by: Nothing | last post by:
I have a search results form that is being displayed as a continous form. I want to double click the name and then using VBA select the different columns of information. For Example: Name ...
5
nfollmer
by: nfollmer | last post by:
Hi, After getting so much help from this site, I decided to join! But thats beside the point.... I'm fairly experienced in C#, but never did anything web related, so I need some help. What I...
0
rrocket
by: rrocket | last post by:
I was wondering if anyone has done an email form in flash with a .NET backend (instead of PHP)? For the Flash side I have this: var variables:URLVariables = new URLVariables(); var...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
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.