Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding hidden fields


stretchr

Recommended Posts

Posted

I hope I'm not missing something obvious but I've searched the forums and docs without finding what I need. I need to pass 2 hidden form values, based upon which option is selected by a customer. For example, Paysystems permits purchasing with recurring billing at specified intervals. Depending on which hosting plan a customer selects, I need to pass the recurring value of 1 and the frequency value of how often to bill, both hidden. Can anyone here point me in the right direction to solve this?

 

Thanks,

Stretchr

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Posted

The problem with dependent hidden variables is that you would have to change the variable to match your other picks. Wouldn't it be easier to figure out what values you need after the POST? Then you could just say "Oh, they picked a recurring option, I'll assign a one to the variable."

 

If all you wanted to do was to pass a variable that didn't have an input or selection device, you could use the tep_draw_hidden_field function. However, you would either have to set up some JavaScript (or something) to update the value based on your other picks, or you would to know the value prior to the customer's selections.

 

I suppose one way to get around this, if I understand what you want, would be to add a confirm page. Then, the customer fills in her or his selections and hits submit. You process the selections and set your hidden fields. When the customer hits submit on the confirmation page, it will have all the data. Note: you will need to have hidden fields for the other data as well on the confirmation page so that it posts a second time.

 

Hth,

Matt

Posted

I would like to hard code a value coz it naver changes but I want it hard coded within a form and that value to be hidden - I would use tep_draw_hidden_field but I don't know how to code it to use a text value as opposed to the derived values it currently processes

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...