Results 1 to 3 of 3

Thread: change submit type to href with onclick

  1. #1
    New user
    Join Date
    10-28-10.
    Posts
    2

    Default 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

  2. #2
    User
    Join Date
    04-27-10.
    Posts
    134

    Default 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?

  3. #3
    New user
    Join Date
    10-28-10.
    Posts
    2

    Default 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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •