Mirror dropdown value in Textbox

CrystalFrontier 26 Jul, 2013
Dear all,

I've been trying to find answers in the forum about what I believe can't be too hard to achieve. I've found similar inquiries, but weren't quite what I wanted.

When I enter a dropdown menu, I assign a value and a text that's shown as an option of choice to the user. Once a choice is made, I'd like the VALUE of that choice to show up in a textbox below (in this case showing a total price of the user's choice separately).

That's all! Can't be too hard, can it? Well, for me it is๐Ÿ˜›, so any help is greatly appreciated.

Thanks and have a nice weekend
Chris
GreyHead 26 Jul, 2013
Hi Chris,

You'll need some JavaScript something like this:
window.addEvent('domready', function(){
  $('drop_down_id').addEvent('change', function() {
    $('text_input_id').value = $('drop_down_id').value;
  });
});

Bob
CrystalFrontier 26 Jul, 2013
Most excellent!!

Works like a charm๐Ÿ˜‰

Thank you very much,
Chris
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger