rails tag issue with html

13 views
Skip to first unread message

amvis

unread,
Mar 20, 2012, 12:45:40 AM3/20/12
to rubyonra...@googlegroups.com
<div class="well original3">
 
<%= form_tag( { :controller => 'businesses', :action => 'create' }, { :id =>        'myform',:class  => 'form-inline offset3', :method => 'post'}) do %>
<%= text_field_tag('mnum' ,nil, :class => "input-xlarge", :style => "text-    align:center;height:28px;",:placeholder => "Enter Mobile Number") %>
 
<%= submit_tag "Get", :id => "da",:class =>     "btn btn-large btn-primary" %>
 
<%end%>
</div>

JQUERY

$(document).ready(function () {
$
("#da").click(function() {
 
//$(".original3").fadeOut(300, function() {
       
//$(".original3").css("display", "block");
        $
(".checked3").css("display", "block");
        $
(".checked3").show();
       
//});
});

});

Basically another Div will be hide via css. when click this Get button that div should show, But here is the problem when i click the GET button the the other div will show and fadeout soon. But when i change the GET button type submit to button that will work properly..? How to avoid this problem...?

vishnu

Thank you



Tom Meinlschmidt

unread,
Mar 20, 2012, 4:03:17 AM3/20/12
to rubyonra...@googlegroups.com
change event from click() to onSubmit

$('#da').bind('submit', function() ...

tom

> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/wVMvPZ1BVEwJ.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

--
===============================================================================
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz
===============================================================================

amvis

unread,
Mar 20, 2012, 4:25:40 AM3/20/12
to rubyonra...@googlegroups.com
Thanks  tom, Here the submission happens, but the other will'not show.. I just give like this

<script language="javascript">
$(document).ready(function () {
  $("#da").bind('submit',function() {
        //$(".original").fadeOut(300, function() {
          
            $(".checked4").css("display", "none");
            $(".checked3").css("display", "block");
            $(".checked3").show();
           });    
        
    });
</script>

 <%= submit_tag "Get", :id => "da", :class => "btn btn-large btn-primary" %>

Thank you
vishnu

> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

--
===============================================================================
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com  www.maxwellrender.cz  www.lightgems.cz
===============================================================================

> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Tom Meinlschmidt

unread,
Mar 20, 2012, 4:41:26 AM3/20/12
to rubyonra...@googlegroups.com
at least, use $().show() or $().hide() instead of setting CSS values

or $().toggle(visible?) where visible is true/false

tom

> > To post to this group, send email to rubyonra...@googlegroups.com.
> > To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.

> > To post to this group, send email to rubyonra...@googlegroups.com.
> > To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.


> > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> ===============================================================================
> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache
>
> www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz
> ===============================================================================
>
>
>
>
>
>
>
>
>

> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/4YEvezL1lXYJ.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.

amvis

unread,
Mar 20, 2012, 5:51:49 AM3/20/12
to rubyonra...@googlegroups.com

Here i do like this

<script language="javascript">
$(document).ready(function () {
  $("#da").bind('submit',function() {
    
            $(".checked4").hide();
            $(".checked3").show();
           });           
    });
</script>

 <%= submit_tag "Get", :id => "da", :class => "btn btn-large btn-primary" %>


Here the checked3 div hide in css(visibility:hidden;), and when the #da button click $(".checked3").show(); 
Have any problem with this..?

> > To post to this group, send email to rubyonrails-talk@googlegroups.com.
> > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages