change submit type to href with onclick
hello, i am new in contao , i would like to know if there is a way to change the submit filed in a form with a
i have the code from modules/frontend/FormSubmit.php
Code:
public function generate()
{
if ($this->imageSubmit && is_file(TL_ROOT . '/' . $this->singleSRC))
{
return sprintf('<input type="image" src="%s" id="ctrl_%s" class="submit%s" alt="%s" value="%s"%s />',
$this->singleSRC,
$this->strId,
(strlen($this->strClass) ? ' ' . $this->strClass : ''),
specialchars($this->slabel),
specialchars($this->slabel),
$this->getAttributes());
}
return sprintf('<input type="submit" id="ctrl_%s" class="submit%s" value="%s"%s />',
$this->strId,
(strlen($this->strClass) ? ' ' . $this->strClass : ''),
specialchars($this->slabel),
$this->getAttributes());
}
the question is how can i get the from id that has the submit button ? somthing like "$this->formid" ... is this possible?
class FormSubmit extends Widget also form submit Widget
thank you
Re: change submit type to href with onclick
Using the form generator you could add an html field and add custom code instead of a submit button.
As for getting the form_id, I guess you could create the form and look at the source code and enter manually.
I could be confused and way off what your asking but would that work for you?
Re: change submit type to href with onclick
thanks, i am using this solution now but i want something gerneral, because there will be admins who don`t know to implement custom html they only know that a form has to have a submit button :)