2016-02-08 51 views
0

大家都知道javascript:void(0)是用來設置action在undefined中的簡單html。但我需要使用同樣的事情在Laravel刀片的規定如下:如何在Laravel的表單動作中使用javascript:void(0)?

{!! Form::open(array('url' => '#', 'class' => 'form-search', 'id'=>'search_form')) !!} 

如何設置窗體行動javascript:void(0)在上面的代碼?我正在使用Laravel 5.1。

+0

您已經定義 'URL'=> '#'。所以沒有必要這樣做。 laravel csrf form token也可以做同樣的事情。 –

回答

0
{!! Form::open(array('url' => '#', 'class' => 'form-search','id'=>'search_form')) !!} 
<!-- Content --> 
     <input type="submit" value="Submit" onclick="function()" > 
</div> 
{!! Form::close() !!} 

,並在()函數

javascript:void(0) 
相關問題