New Zenner
- Join Date:
- Jun 2006
- Location:
- Salem, West Virginia
- Posts:
- 15
- Plugin Contributions:
- 0
Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons
The code that you posted earlier that doesn't work for me is this snippet which you said you added to the CSS Buttons Function:
if ($type == 'submit'){
// form input button
$css_button = '<input class="' . $mouse_out_class . '" ' . $css_button_js . ' type="submit" value="' .$text . '"' . $parameters . $style . ' />';
// bof hack to simulate image button! (add _x and _y parameters to $_POST)
// needed for gv name="edit" button (other named buttons are name="btn_submit" and name="submit1" and ...??)
if (strpos($parameters, 'name')!== false){
$s=strpos($parameters, '"', strpos($parameters, 'name'))+1;
$e=strpos($parameters, '"', $s);
$name = substr($parameters, $s, $e-$s);
$_SESSION['buttons_name_array'][] = $name; // debug
$css_button .= "\n" . '<input type="hidden" name="' . $name . '_x" value="1" />';
$css_button .= "\n" . '<input type="hidden" name="' . $name . '_y" value="1" />';
}
// eof hack to simulate image button!
}
What that will do on a default Zen Cart installation is add two hidden input forms named edit_x and edit_y that are submitted with the Gift Certificate Confirmation form. And, naturally, they are submitted whether the "Edit" button or the "Submit" button is used. Therefore, both buttons take me back to the edit page. Am I making any sense?
Good luck on your CSS Buttons mod! I haven't tried it out yet but I just might take it for a spin. Do you mind filling me in again on what additional features it offers that the default Zen Cart CSS Buttons don't?