[TYPO3-project-formidable] How to confirm at client?
    Loredana ZECA 
    l.zeca at ameos.com
       
    Wed Jul  2 09:28:45 CEST 2008
    
    
  
Hy Thomas,
You can try this one:
<renderlet:BUTTON name="btnClose" label="Close">
	<onclick runat="server">
		<confirm>Are you sure you want to close without saving your 
changes?</confirm>
		<userobj>
			<php><![CDATA[/*<?php*/
				$sLink = $this->cObj->typolink_URL(
					array(
						"parameter" => 16,
						"returnLast" => "url",
						"useCacheHash" => "1",
					)
				);
				return $this->sendToPage($this->toWebPath($sLink));
			/*?>*/]]></php>
		</userobj>
	</onclick>
</renderlet:BUTTON>
You can use a <renderlet:BUTTON>, instead of <renderlet:SUBMIT>.
The control <renderlet:SUBMIT> are executing the saves on form, but 
<renderlet:BUTTON> not, only if you are specifing them explicitly.
So, I hope this will help you.
Regards,
Loredana
Thomas Schikarski a écrit :
> Hi everybody,
> 
> I'm stuck at some point building a CRUD form.
> 
> I need a button that allows to close the edit form without saving 
> changes, similar to this one:
> 
> <renderlet:SUBMIT name="btn-close" label="Close" mode="clear" />
> 
> However, I like to present a query box for confirmation: "Are you sure 
> you want to close without saving your changes?"
> 
> Is this possible using something like the following XML inside the 
> renderlet:SUBMIT?
> 
>     <onclick runat="client">
>         <confirm>
>             <userobj>
>                
>                 ... // should present query box like
>                     // javascript:confirm('...');
>            
>             </userobj>
>         </confirm>
>         <userobj>
> 
>             ... // should submit the form with mode="clear",
>                 // in case of "OK" click
> 
>         </userobj>
>     </onclick>
> 
> What do I have to put inside the <userobj> tags? Majix-Events? 
> Javascript? PHP? Return value?
> 
> Any better ideas?
> 
> Best regards and many thanks in advance!
    
    
More information about the TYPO3-project-formidable
mailing list