Advertisement
Guest User

code_jquery

a guest
May 14th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 2.00 KB | None | 0 0
  1. This is my view page code
  2.         <!--offer job-->
  3.  
  4.         <div id="offer_job" class="login-popup" style="width:500px;">
  5.           <a href="#" class="close"><img src="/assets/newa/images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
  6.  
  7.           <h3>CONFIRM JOB OFFER</h3><hr>
  8.  
  9.           <%= render 'share_mail/formOffer' %>
  10.          
  11.         </div>
  12.         <!--/offer job-->
  13.  
  14.  
  15.  
  16. My partial code :
  17.  
  18. <%= form_for(:offer, :url => {:controller=> 'emails', :action => 'offer'},  :remote => true, :html => { :method => :post, :id => 'formOffer'}) do |f| %>
  19.  
  20. <% if @applicant.blank? %>
  21. <p>
  22.         <%= f.label :to4, "TO *" %>
  23.         <%= f.text_field(:to4, :class =>"text-input") %>
  24.       </p>
  25. <%else%>
  26. <p>
  27.         <%= f.label :to4, "TO *" %>
  28.         <%= f.text_field(:to4, :value => @applicant.email, :class =>"text-input") %>
  29.       </p>
  30. <%end%>
  31.  
  32.       <p>
  33.         <%= f.check_box(:send_me_copy) %> Send me a copy
  34.       </p>
  35.            
  36.       <p class = "one-half">
  37.         <%= label_tag "offer_template", "TEMPLATE *" %>
  38.         <%= collection_select("offer_template", {}, EmailTemplate.where(:company_id => current_user.company_id, :template_type => "Job Offer"), :id, :name, {:prompt=>'Please select'}, {:class => "text-input", :id => 'offer_template'}) %>
  39.       </p>
  40.      
  41.       <div class="clear"></div>
  42.          
  43.       <p>
  44.         <%= f.label :subject4, "SUBJECT *" %>
  45.         <%= f.text_field(:subject4, :class =>"text-input") %>
  46.        </p>
  47.        
  48.         <p>
  49.         <%= f.label :message4, "MESSAGE *" %>
  50.         <%= f.text_area(:message4, :class =>"textarea", :style => "height:140px") %>
  51.       </p>
  52.  
  53.       <button class="button medium green" type="submit" onclick='block()'><span>Send</span></button>
  54.       <button class="button medium green" type="reset"><span>Cancel</span></button>
  55.  
  56. <%end%>
  57.  
  58.  
  59.  
  60.  
  61. My jquery code :
  62. $('#offer_template').click(function() {
  63.  
  64.       id = document.getElementById("offer_template").value;
  65.       alert(id);
  66.      
  67.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement