EncodeURIComponent in form_remote_tag

Hi All,

for one particular reason ( particular div layouts to enable opaque
text on on transparent div), my end form tag is appearing before my
single text box, as shown below :

<% form_remote_tag(:update=>'yourpoints', :url => { :controller=>'promotioncodes', :action=>'redeem_code'},:method=>'post' ) do %> <%= link_to_remote image_tag('../images/redeem_code_bttn.png'), { :url => {:controller=>'promotioncodes',:action => 'checkvalidity' }, :with => 'code='+encodeURIComponent(code) } %>
<%= text_field_tag :code, params[:code],:size=>'25px',:style=>'margin-top:5px;height:25px;border- width:1px;border-color:white;font-size:13px;' %>


<% end %>

Source code from mozilla shows clearly that the end form tag appears
before my text box.
And also, I’m forced to use this layout to avoid my textbox from being
transparent.

That’s why I’m using encoreURIComponent in my link_to_remote tag.

But not functionning right now…

Does anyone know how I can solve this.

Regards,

Joel

On May 21, 11:45 pm, joel [email protected] wrote:

Hi All,

for one particular reason ( particular div layouts to enable opaque
text on on transparent div), my end form tag is appearing before my
single text box, as shown below :

Your html is screwed: you’re closing tags in the wrong order (eg
inside your form you’re closing a div which you opened outside your
form) and so the browser is just guessing at what you meant. Also
your :with parameter looks mesed up to me (I’m surprised that it even
runs, given that encodeURIComponent is a javascript function and that
you don’t appear to have a code variable defined (in ruby or in
javascript). I wrote up some stuff on :with at

a few days ago.

Fred