views:

870

answers:

2

im trying this format:

$("#<%= hfWidth.UniqueID %>").val($("#drag").attr("offsetWidth"));

to fill the hidden field with client-side values

but when I do postback, the values doesn't seem to be saved.

help

A: 

If you want to get params from the server side, you should use name instead of id attribute.

And your code should work :

$("#elementId").val("value");
Braveyard
the .UniqueID is the value set to the name attribute of the object.
Martin Ongtangco
Can you provide us more code than that ? Because this code doesn't show sufficient info. Thanks.
Braveyard
thanks, i solved it eventually.
Martin Ongtangco
A: 

fixed it with <%= hfWidth.ClientID %>

Martin Ongtangco
You should mark your own answer as "accepted" so people don't continue to see this question in the "unanswered" list, and so your accept rate increases.
Conspicuous Compiler
This is only possible after 2 days.
Jan Jongboom
yep.. im stuck with this for 2days... who ever made that stupid rule?
Martin Ongtangco