开发者

Problems with jquery sexy post, javascript response and placeholder attribute

I'm currently working on a rails app in which I have a form which is submitted with jquery sexy post and gets back a js response, the code below was working fine but after I added the placeholder attribute for some reason it got broken.

= form_for [@room, @room.messages.new], :html => { :multipart => true } do |f|
    = f.text_area :text, :size => "60x1", :class => "field", :placeholder => "say something"
    = f.submit "Send"
    = f.file_fiel开发者_开发问答d :image, :class => "img_field"
  = link_to "Add Image", "#", :id => "add_imgLink"

The form is being submitted and we get the answer back from the server, though, the js response is not being executed and the form is not being refreshed, any idea what of what could be possible going wrong ?

Thanks!

-- UPDATE:

Just find out that if I replace :placeholder by :value, it does works, but if I don't include :value it doesn't.

UPDATE2:

I found the problem and it wasn't related with jquery, rails or js, one of my coworkers modified sexypost and introduced a bug. Problem fixed.


I'd guess the space in the string. Try url encoding it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜