Well, ok, forget about the page's source,
my mistake mentioning this,
my real problem is that the variable show its 'original' value when
submitted to the server and not the one that javascript changed to!
Why isn't that variable/field 'refreshed'?
Do I need to do something (like a 'refresh')?
"Peter Bromberg [C# MVP]" wrote:
> It seems to me that Bruce's response was quite explanatory, read it again for
> the answer.
> Peter
>
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
>
>
>
>
> "patrickdrd" wrote:
>
> > Yes, but when the page is posted back to the server,
> > the change that javascript made isn't recognized by the server code,
> > while the server recognizes changes made through user input,
> > it doesn't know changes made by javascript! Why?
> >
> >
> > "bruce barker" wrote:
> >
> > > view source shows what the server sent, not the current state of the
> > > page. if javascript changed anything it is not reflected in the source.
> > >
> > > for example view source of this page looks nothing like the rendered html:
> > >
> > > <html>
> > > <body>
> > > <script>
> > > for(var i=0; i< 100; ++i) document.write('hello ' + i + '<br>');
> > > </script>
> > > </body>
> > > </html>
> > >
> > >
> > > -- bruce (sqlwork.com)
> > >
> > >
> > > patrickdrd wrote:
> > > > Hi everyone!
> > > >
> > > > I have a hidden input field in a form which I change in some occasions on
> > > > the client using javascript,
> > > > but when I use "view source" I can't see these changes reflected on the page!
> > > >
> > > > Does anyone know what I should do in order for the page to know the change?
> > > > (Tried with enableviewstate=false, true, whatever, didn't work)
> > > >
> > > > I would like to have the change reflected in the page without doing a
> > > > postback or on the postback!
> > > >
> > > > Is this possible? Thanks in advance!
> > >