var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
How do I receive dynamic data from a web form?
I finally was able to find a good form processing script and it works very nicely. Sends all the selected form values to my e-mail but theres one important piece of data that it doesn't send. My dynamic data.
I have a web form that updates the shipping price depending on what someone selects in the drop down menu forms. I want to be able to receive that shipping data to my e-mail but I can't quite figure it out. Heres what the script looks like.
<div id="dynamic_ship_price" name="dynamic_ship_price"><p align="left">$0.00</font></p>
I bet if I could somehow have that data be shown in a text box it would send to my e-mail. I tried putting <select> </select> around it but that didn't work.
Any help is much appreciated, thanks!
you can use <input type="hidden">$cost</input> or simple use php sessions to carry the data from one page to another.
this one give you a drop down box with two options. $5 and $10
Okay well I tried your suggestion Rahde. So it looks like this now
<input type="hidden" id="dynamic_ship_price" name="dynamic_ship_price">$0.00</input>
The prices do not update now when I select things in the rest of the form. I also receive an e-mail with dynamic_ship_price being blank.
I really like your idea about using php but I wouldn't know where to start.
err I should clarify that i'm really not inerested in the PhP solution to this. Even though I did say I like the idea, sounds like too much work. Rather just stick with what i've got going.
Its really not that difficult.
<div> <p> and such tags are not sent with a form request, that's why you are not getting your data.
You almost had it
<input type="hidden" name="ship_price" id="ship_price" value="0.0" />
Now, just adjust your script so that when someone changes the shipping price, it updates the value for that hidden field. Something like :
document.getElementById('ship_price').value = 2.5;
and you can then read the value using 'ship_price' as the key. $_POST['ship_price'] $_GET['ship_price'] etc.
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my
Signal > Noise
look at this tutorial, it might help u a bit:
if you do not want to learn, then pay for someone to do it??
It is not a bad idea to learn new things! Is it??
Testing 1.. Testing 1..2.. Testing 1..2..3...
Lol no it's not a bad thing to learn new things it's just that my memory sucks so when I learn something I forget it a week later
I suppose I really do need the PHP option because it would be great to preview the page. I'll take a look at that tutorial thanks.
And thanks everyone for the help. I'm gonna give fyrestrtr's idea a try and see what happens
Well fyrestrtr I tried your suggestion and the ship price did send to my e-mail but only the default 0.0 value
I'll see if I can try a PHP session.
well actually I noticed since the field is hidden I really don't know the 0.0 value so I tried it like this.
<input type="hidden" name="ship_price" id="ship_price"/>
This time I got an e-mail with this ship_price ,
hmmm whered that comma come from
Well i've decided not do try php just yet. I'm thinking theres an easy solution to this so i'll bump it back up to the top and see if anyone else has an idea
What about this script
<form name="f1" action="test.html">
<select name="cost" onblur="call(cost)">
<input type="hidden" name="dynamic_ship_price" value="$0.00">
<input type="submit" value="Click Me">
Try by changing type "hidden" to "text " you can see the number in text box.