Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

How to check which radio button or dropdown is selected?


Recommended Posts




I want to check if an option has been selected on the product_info page then output an alert based upon whats been selected.


I tried using onclick nothing happens.


product_info page:


tep_draw_radio_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, 'onClick="alert($products_options_array);"');


html_output page:


function alert($values){


for ($i=0, $n=sizeof($values); $i<$n; $i++) {


$string = $values[$i]['text'];

$x='you have selected' . $string;

return $x;



Link to comment
Share on other sites


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

  • Create New...