trongate / trongate-framework

The Trongate PHP framework
https://trongate.io
Other
1.11k stars 100 forks source link

form_helper.php form_hidden() - Additional Code not working #171

Closed redjaffa closed 1 month ago

redjaffa commented 5 months ago

Hi DC, Codefire here.

$additional_code is being passed to the form_hidden() "attributes" param instead of the "additional code" param.

function form_hidden($name, $value = null, $additional_code = null) { $html = form_input($name, $value, $additional_code); $html = str_replace(' type="text" ', ' type="hidden" ', $html); return $html; }

Should be as below:

function form_hidden($name, $value = null, $additional_code = null) { $html = form_input($name, $value, NULL, $additional_code); $html = str_replace(' type="text" ', ' type="hidden" ', $html); return $html; }

Cheers

trongate commented 5 months ago

Thank you. You're right. Nicely spotted!

Your solution is good. Could you please copy the code below and replace the form_hidden() function, then submit a pull request? I'd like you to be given the credit for this.

/**

trongate commented 5 months ago

Here it is on pastebin, for easier copying and pasting: https://pastebin.com/G6dHYqsf

trongate commented 1 month ago

I hope we're good. If not, please reopen.