#1734 某竞赛主页中当搜索框为空时,点击搜索的提示问题
This commit is contained in:
parent
f834759d84
commit
30d8d82f37
|
@ -21,36 +21,36 @@
|
||||||
<td rowspan="2" >
|
<td rowspan="2" >
|
||||||
<div class="project-search" style="float: right">
|
<div class="project-search" style="float: right">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function regexName()
|
function regexName1()
|
||||||
{
|
{
|
||||||
var name = $.trim($("#name").val());
|
var name = $.trim($("#name").val());
|
||||||
if(name.length == 0)
|
if(name.length == 0)
|
||||||
{
|
{
|
||||||
$("#contest_name_span").text("<%= l(:label_search_conditions_not_null) %>");
|
$("#contest_name_span_head").text("<%= l(:label_search_conditions_not_null) %>");
|
||||||
$("#contest_name_span").css('color','#ff0000');
|
$("#contest_name_span_head").css('color','#ff0000');
|
||||||
$("#contest_name_span").focus();
|
$("#contest_name_span_head").focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$("#contest_name_span").text("");
|
$("#contest_name_span_head").text("");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitSerch()
|
function submitSerch()
|
||||||
{
|
{
|
||||||
if(regexName()){$("#contests_serch").submit();}
|
if(regexName1()){$("#contests_serch").submit();}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName();' %>
|
<%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName1();' %>
|
||||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||||
<%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
|
<%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
|
||||||
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;">
|
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;">
|
||||||
<%= l(:label_search)%>
|
<%= l(:label_search)%>
|
||||||
</a>
|
</a>
|
||||||
<br />
|
<br />
|
||||||
<span id="contest_name_span"></span>
|
<span id="contest_name_span_head"></span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -37,37 +37,37 @@
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="2" width="250px">
|
<td rowspan="2" width="250px">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function regexName()
|
function regexName1()
|
||||||
{
|
{
|
||||||
var name = $.trim($("#name").val());
|
var name = $.trim($("#name").val());
|
||||||
if(name.length == 0)
|
if(name.length == 0)
|
||||||
{
|
{
|
||||||
$("#contest_name_span").text("<%= l(:label_search_conditions_not_null) %>");
|
$("#contest_name_span_head").text("<%= l(:label_search_conditions_not_null) %>");
|
||||||
$("#contest_name_span").css('color','#ff0000');
|
$("#contest_name_span_head").css('color','#ff0000');
|
||||||
$("#contest_name_span").focus();
|
$("#contest_name_span_head").focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$("#contest_name_span").text("");
|
$("#contest_name_span_head").text("");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitSerch()
|
function submitSerch()
|
||||||
{
|
{
|
||||||
if(regexName()){$("#contst_search_form").submit();}
|
if(regexName1()){$("#contst_search_form").submit();}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<div class="project-search">
|
<div class="project-search">
|
||||||
<%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %>
|
<%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %>
|
||||||
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName();' %>
|
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();' %>
|
||||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||||
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||||
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;">
|
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;">
|
||||||
<%= l(:label_search)%>
|
<%= l(:label_search)%>
|
||||||
</a>
|
</a>
|
||||||
<span id="contest_name_span"></span>
|
<span id="contest_name_span_head"></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue