why does javascript lie?

0 views
Skip to first unread message

patrick

unread,
Nov 10, 2009, 10:47:20 PM11/10/09
to Prototype & script.aculo.us
Ok, this is really annoying me... When you make changes to form
elements, and refresh the page, they don't go back to their defaults
regardless of what the html says "selected" is... My plan was to have
prototype set my form elements to their selected value when the page
loads, however when I implemented this, it did not work... I could
not understand why.

So, for a test.. I went to one of my pages and selected option 2 of a
select... then in the console I did:

$F('my_select');
>> "2"

... ok cool...

Refreshed the page... Looked at the html:

<option value="1" selected="selected">1</option>

... guess what?

$F('my_select');
>> "2"

LIAR!!!!!!!!

why does it lie???

-patrick
Reply all
Reply to author
Forward
0 new messages