• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Hidden Field Problem in Dreamweaver

Hi All,
So I have a page where a recordset is populating a drop-down menu. Each record has a name and a price associated with it. The names are displayed in the drop-down. On the submit of the form, I want the price of the field that the user has selected in the drop-down to be passed to another page (Paypal). I've put a hidden field on the page where I think the price should be stored. What is the easiest way to achieve this?
Thanks,
Derek
0
dereksheahan
Asked:
dereksheahan
1 Solution
 
Jason C. LevineNo oneCommented:
Hi Derek,

Create a recordset on the receiving page that is tied to the form value from the submitting page.  The recordset returns only the price from the object selected and then you don't need the hidden field, just access it through the Bindings panel.

0
 
siva350Commented:
A hidden field would work fine if you set its value to the variable for the price then when you submit your form it will carry the formdata across to your processing script. THe way Jason said to do it would be a more secure and probably better way to go about it.
0
 
Jason C. LevineNo oneCommented:
siva,

Your method would require a little javascript to set the value of a hidden field based on a pull down, wouldn't it?
0
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

 
v2MediaCommented:
The list menu has a name/value pair for each select option. The name attribute for the select element will be passed to the file that the form submits to along with the value of the selected option. This info is passed in the POST headers of the html. You don't need a hidden input to pass the value.

On the page that the form submits to, all you have to do is grab the value from the POST array. If the language your working in is php for example; all you would have to do is;
<?php
// create a var to assign the POST value to

$iPrice = '';

if(isset($_POST['formSelectName'])){

$iPrice = $_POST['formSelectName'];

}

?>

You can then echo that value in whatever page element is required, for eg;

<input type="hidden" name="itemPrice" value="<?php echo $iPrice; ?>" />

In other languages, the concept is the same.
0
 
dereksheahanAuthor Commented:
Hi guys,
Well all I need to do really is submit the details of the selected drop-down's and pass it to paypal. I haven't used Paypal before and have spent the last few days reading some of the documentation. Therefore I
0
 
dereksheahanAuthor Commented:
....really only want to psot the price of the item to paypal. So the receiptant page would be the paypal page. As I said I haven't done this before. Is it easy to set-up a paypal to do this?
Thanks,
D
0
 
Jason C. LevineNo oneCommented:
Paypal is pretty easy to deal with.  Your form fields have to be named a certain way and you need to follow some other guidelines, but when you get down to it, it is just another form operation and you ought to be able to handle those in your sleep at this point.
0
 
dereksheahanAuthor Commented:
Hi Jason, I think I'll just post my query in a new question to get you some more points
0
 
Jason C. LevineNo oneCommented:
LOL, I was kidding about that, but feel free.  
0
 
Jason C. LevineNo oneCommented:
Also, you may want to post it in the E-Commerce TA and not DW.  Frankly, you've moved beyond the DW TA scope and you should probably post your questions in PHP and E-Commerce areas.  In the beginning, you were working with the DW built in code, so it made sense but now you are basically writing your own code and there are many better ways of doing it and MANY people better than I am who can help you.

Not that I mind helping you, I just want to make sure you get the best bang for the buck.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now