473,326 Members | 2,090 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,326 software developers and data experts.

sending variables via cgi form?

Hello,

I have been able to create a slider using Javascript code from the web
but would like to send the slider values which are saved in an array
to myself using email and the CGI/form approach.

I'm not clear how to get the these array values into the form ..

Hints/ideas please!

Cheers

Geoff
Sep 1 '05 #1
7 2115
Hi,
Your question is not clear. Please post your code along with the
question which would be easier to understand your problem.

Anyways, try using XMLHTTP or XMLRequest to post the values to the
server.

- Peroli Sivaprakasam

Sep 1 '05 #2
On 1 Sep 2005 02:20:42 -0700, "Peroli" <pe****@gmail.com> wrote:
Hi,
Your question is not clear. Please post your code along with the
question which would be easier to understand your problem.

Peroli,

Thanks for your reply. At the moment the code below puts the slider
value into

<SPAN ID="Slider1ValueText"></SPAN>

I would like to be able to put that value into a form so that the
value could be sent to me via email using formmail.cgi.

Cheers

Geoff
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<HEAD>
<SCRIPT
SRC="http://www.micro-active.com/slider/christiaan/slider.js"></SCRIPT>
<SCRIPT>

var mySlider1 = new Slider( "Slider1" );

mySlider1.leftValue = 0;
mySlider1.rightValue = 10;
mySlider1.defaultValue = 0;

mySlider1.offsetX = 1;
mySlider1.offsetY = 1;
mySlider1.maxSlide = 258;

mySlider1.onmouseover = "self.status='Try me!'";
mySlider1.onmousedown = "self.status='You start at
'+this.getValue(0)";
mySlider1.onmouseup = "self.status='You end at '+this.getValue(0)";
mySlider1.onchange = "self.status='The current value is
'+this.getValue(0)";
mySlider1.onclick = "this.setValue(this.defaultValue)";

mySlider1.onchange =
"document.getElementById('Slider1ValueText').inner HTML =
''+this.getValue(0)"

</SCRIPT>
</HEAD>

<BODY onLoad="mySlider1.placeSlider()">

<TABLE>
<TR>
<TD COLSPAN="3">
<IMG SRC="sliderbg.gif" NAME="Slider1RailImg" ID="Slider1RailImg">
<TR>
<TD ALIGN="left"> 0
<TD ALIGN="center"> Slider 1
<TD ALIGN="right"> 10
</TABLE>

<SPAN ID="Slider1ValueText"></SPAN>

<SCRIPT>

mySlider1.writeSlider();

</SCRIPT>
</body>
</html>




Anyways, try using XMLHTTP or XMLRequest to post the values to the
server.

- Peroli Sivaprakasam


Sep 1 '05 #3
Hi Geoff,
I have edited your script below. Please download the prototype.js
that i have included.
1. Update the url of the CGI script in function saveIt().
2. In the CGI Script, find the slider value in "SliderVal" parameter.

Test if it works.... It should.

- Peroli Sivaprakasam
___________________________________________
[UNTESTED]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<HEAD>
<SCRIPT
SRC="http://www.micro-active.com/slider/christiaan/slider.js"></SCRIPT>
<SCRIPT
SRC="http://prototype.conio.net/dist/prototype-1.3.1.js"></SCRIPT>
<SCRIPT>

var mySlider1 = new Slider( "Slider1" );

mySlider1.leftValue = 0;
mySlider1.rightValue = 10;
mySlider1.defaultValue = 0;

mySlider1.offsetX = 1;
mySlider1.offsetY = 1;
mySlider1.maxSlide = 258;

mySlider1.onmouseover = "self.status='Try me!'";
mySlider1.onmousedown = "self.status='You start
at'+this.getValue(0)";
mySlider1.onmouseup = "self.status='You end at '+this.getValue(0)";
mySlider1.onchange = "self.status='The current value
is'+this.getValue(0)";
mySlider1.onclick = "this.setValue(this.defaultValue)";

mySlider1.onchange
="document.getElementById('Slider1ValueText').inne rHTML
=''+this.getValue(0)";
//---------------------------------------------------------------------
function saveIt()
{
var url = 'http://yourserver/sendMail.cgi';
var pars =
'sliderVal='+document.getElementById('Slider1Value Text').innerHTML;
var myAjax = new Ajax.Updater('Status', url, {method: 'get',
parameters: pars});
}
//---------------------------------------------------------------------
</SCRIPT>

</HEAD>

<BODY onLoad="mySlider1.placeSlider()">

<TABLE>
<TR>
<TD COLSPAN="3">
<IMG
SRC="http://www.micro-active.com/slider/christiaan/sliderbg.gif"
NAME="Slider1RailImg" ID="Slider1RailImg">
<TR>
<TD ALIGN="left"> 0
<TD ALIGN="center"> Slider 1
<TD ALIGN="right"> 10
</TABLE>
<input type="button" value="save slider value" onclick="saveIt()" />
<SPAN ID="Slider1ValueText"></SPAN>
<SPAN ID="Status"></SPAN>

<SCRIPT>

mySlider1.writeSlider();

</SCRIPT>

</body>
</html>

Sep 1 '05 #4
On 1 Sep 2005 04:27:39 -0700, "Peroli" <pe****@gmail.com> wrote:
Hi Geoff,
I have edited your script below. Please download the prototype.js
that i have included.
1. Update the url of the CGI script in function saveIt().
2. In the CGI Script, find the slider value in "SliderVal" parameter.

Test if it works.... It should.
Peroli,

It works fine - many thanks! Will now try and work out how you did
it!! May get back to you...

Cheers

Geoff



- Peroli Sivaprakasam
___________________________________________
[UNTESTED]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<HEAD>
<SCRIPT
SRC="http://www.micro-active.com/slider/christiaan/slider.js"></SCRIPT>
<SCRIPT
SRC="http://prototype.conio.net/dist/prototype-1.3.1.js"></SCRIPT>
<SCRIPT>

var mySlider1 = new Slider( "Slider1" );

mySlider1.leftValue = 0;
mySlider1.rightValue = 10;
mySlider1.defaultValue = 0;

mySlider1.offsetX = 1;
mySlider1.offsetY = 1;
mySlider1.maxSlide = 258;

mySlider1.onmouseover = "self.status='Try me!'";
mySlider1.onmousedown = "self.status='You start
at'+this.getValue(0)";
mySlider1.onmouseup = "self.status='You end at '+this.getValue(0)";
mySlider1.onchange = "self.status='The current value
is'+this.getValue(0)";
mySlider1.onclick = "this.setValue(this.defaultValue)";

mySlider1.onchange
="document.getElementById('Slider1ValueText').inn erHTML
=''+this.getValue(0)";
//---------------------------------------------------------------------
function saveIt()
{
var url = 'http://yourserver/sendMail.cgi';
var pars =
'sliderVal='+document.getElementById('Slider1Valu eText').innerHTML;
var myAjax = new Ajax.Updater('Status', url, {method: 'get',
parameters: pars});
}
//---------------------------------------------------------------------
</SCRIPT>

</HEAD>

<BODY onLoad="mySlider1.placeSlider()">

<TABLE>
<TR>
<TD COLSPAN="3">
<IMG
SRC="http://www.micro-active.com/slider/christiaan/sliderbg.gif"
NAME="Slider1RailImg" ID="Slider1RailImg">
<TR>
<TD ALIGN="left"> 0
<TD ALIGN="center"> Slider 1
<TD ALIGN="right"> 10
</TABLE>
<input type="button" value="save slider value" onclick="saveIt()" />
<SPAN ID="Slider1ValueText"></SPAN>
<SPAN ID="Status"></SPAN>

<SCRIPT>

mySlider1.writeSlider();

</SCRIPT>

</body>
</html>


Sep 1 '05 #5
On 1 Sep 2005 04:27:39 -0700, "Peroli" <pe****@gmail.com> wrote:

Peroli,

Is it possible not to show the slider value?

<SPAN ID="Slider1ValueText"></SPAN>

ie can I have the ID="Slider1ValueText" as a hidden property?

Cheers

Geoff
Sep 1 '05 #6
On 1 Sep 2005 04:27:39 -0700, "Peroli" <pe****@gmail.com> wrote:

Peroli,

Have sorted the invisible <span> by using css but one other thing.

After the slider value has been submitted a message appears saying
Thank you etc and giving the slider value.

I do not wish that value to be seen and cannot stop it!

<input type="hidden" name="redirect"
value="http://website/path/thanks.htm" />

does not work - still get the Thank you message!

What is happening?

Cheers

Geoff

Sep 1 '05 #7
Hi Geoff,
Replace the saveIt() with the code given below. You can replace the
"Status" Span too.

function saveIt() {
var url = 'http://yourserver/mail.cgi';
var pars
='sliderVal='+document.getElementById('Slider1Valu eText').innerHTML;
var myAjax = new Ajax.Request(
url,
{method: 'get', parameters: pars, onComplete:
function(){alert("Mail Sent.")}}
);
}
<input type="hidden" name="redirect"
value="http://website/path/thanks.htm" />
What are you doing here with this Hidden Input? Is this the output you
get from AJAX? Info needed.

Some Info for you.
1. Learn XMLHTTP or AJAX
2. Learn Prototype.js and understand it. Good place to start is
http://www.sergiopereira.com/articles/prototype.js.html

We are calling your cgi script with a cgi param "sliderVal" from
Javascript using AJAX and displaying the response. If you dont want the
responsse to be shown, then do nothing in the "onComplete" handler of
"AJax.Request" Object.

- Peroli Sivaprakasam

Geoff Cox wrote: On 1 Sep 2005 04:27:39 -0700, "Peroli" <pe****@gmail.com> wrote:

Peroli,

Have sorted the invisible <span> by using css but one other thing.

After the slider value has been submitted a message appears saying
Thank you etc and giving the slider value.

I do not wish that value to be seen and cannot stop it!

<input type="hidden" name="redirect"
value="http://website/path/thanks.htm" />

does not work - still get the Thank you message!

What is happening?

Cheers

Geoff


Sep 2 '05 #8

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

Similar topics

16
by: Jochen Daum | last post by:
Hi! I have a function in a lot of pages, which redirects to a new page, if a form has been submitted: if (!(defined("DEBUG_INSERT") && DEBUG_INSERT) && !(defined("DEBUG_UPDATE") &&...
3
by: Shaun Demellweek | last post by:
When you use a form to insert data into a MySQL database, how can you set it up so that the fields are not sent via the address bar. For example: page1.php ___________ <form...
2
by: Wee Bubba | last post by:
my page is split into 2 frames. my upper frame contains a data entry form consisting of asp.net textbox server controls. my lower frame displays rows of data. when a user clicks the submit...
7
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server...
3
by: jamie | last post by:
Is there a way of sending a structure, or a class over tcpip? The current way I am trying to do it is by using a binary writer and sending the individual variables one by one. I know there is...
17
by: ft310 | last post by:
I have a form <td ID="but" width="20%" style="height: 30px; vertical-align: top ;"> <form class="frmform" name="close01" action="index.htm"/> <p style="text-align: center; margin-top: 0;...
1
by: Taras_96 | last post by:
Hi everyone, I've downloaded the PHP code at http://www.inventory-management.org/ and am currently in the process of trying to get the code up and running. I am running PHP version 5.1.6.6, so I...
0
by: joshuajnoble | last post by:
Hi all, I'm having a strange problem where I need to build out form variables in an HTTPWebRequest and send them to an aspx page for processing. The page isn't recognizing the form variables at...
7
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
3
by: raj200809 | last post by:
when i m sending mail i received error from symantec Antivirus" Your email message was unable to be sent because your mail server rejected the message 550-5.7.1 the ip you’re using to send mail is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.