Confused on setValue encoding

33 views
Skip to first unread message

kstubs

unread,
Mar 4, 2012, 8:01:24 PM3/4/12
to prototype-s...@googlegroups.com
Does setValue() encode in anyway the value you set on a form input?  Specifically, I am setting a hidden form element.
I seem to be getting mixed results and I have both encoded and non-encoded values to test with.  I am getting inconsistent results.  

When I invoke submit(), is there an encoding occurring?  I'm a little confused.

Karl..


Phil Petree

unread,
Mar 5, 2012, 3:28:27 AM3/5/12
to prototype-s...@googlegroups.com
just use:     $('var_name').value = "form_data_you_want";




--
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/E45p2JDfyK8J.
To post to this group, send email to prototype-s...@googlegroups.com.
To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.

kstubs

unread,
Mar 5, 2012, 10:19:44 AM3/5/12
to prototype-s...@googlegroups.com
Is this supported across all the browsers?  I'm still hoping to get some input on the setValue method and the encoding that takes place behind the sheets.  I'd like to use this method and don't understand the behavior.

Karl..


On Monday, March 5, 2012 1:28:27 AM UTC-7, ppetree wrote:
just use:     $('var_name').value = "form_data_you_want";


On Sun, Mar 4, 2012 at 8:01 PM, kstubs <kst...@gmail.com> wrote:
Does setValue() encode in anyway the value you set on a form input?  Specifically, I am setting a hidden form element.
I seem to be getting mixed results and I have both encoded and non-encoded values to test with.  I am getting inconsistent results.  

When I invoke submit(), is there an encoding occurring?  I'm a little confused.

Karl..


--
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/E45p2JDfyK8J.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to prototype-scriptaculous+unsub...@googlegroups.com.

Phil Petree

unread,
Mar 5, 2012, 10:29:15 AM3/5/12
to prototype-s...@googlegroups.com

$().value = is working across all browsers and versions on my site

To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/DFeV9Sfw1FkJ.
To post to this group, send email to prototype-s...@googlegroups.com.
To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com.

Victor

unread,
Mar 5, 2012, 12:52:56 PM3/5/12
to prototype-s...@googlegroups.com
Is this supported across all the browsers?  I'm still hoping to get some input on the setValue method and the encoding that takes place behind the sheets.  I'd like to use this method and don't understand the behavior.

setValue() for hidden input just assigns
element.value = value;
without any encoding. Values are encoded before form submission.

diegoturriaga

unread,
Mar 6, 2012, 8:50:33 AM3/6/12
to Prototype & script.aculo.us
first of all: you indicate any encoding in the header of the page?

second: the encoding of the files match?

if js expected an encoding, but the constant is assigned to these in
other encoding... you know what is the problem ;)

a bit more but in spanish:
se puede indicar la codificación del charset en el header de la página
web
pero si el documento no está guardado en el mismo charset, cuando
hagas asignaciones, se mal interpretarán los caracteres.

mi recomendación sería que especifiques (si no lo haces) la
codificación que debe usar el navegador para interpretar y mostrar los
caracteres;
que edites los archivos con algun editor que te permita cambiarle el
charset al docuento (por ejemplo el notepad++) y te asegures que
coincidan el charset del documento y el indicado en el header.

con eso ya no debieras tener más problemas...
Reply all
Reply to author
Forward
0 new messages