473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Value not gettin gwrittne to the DOM.

Hi,

I am a newbie to javascript.

Iam working on a page that has two radio buttons and a tree. I do not
have my tree nodes to be selectable.
Iam working on Firefox.
I have the firebug debugger attached.
Actually this is about a problem iam trying to debug. And found what
the problem is and iam looking for a hack/ workaround to fix the bug.

With one radio button selected and I working on the tree, the values
for actions of tree collapse or tree expand get sent to the server from
my javascript correctly. Before the page is submitted from javascript
to the server, I can see these collapse/ expand values reflected for my
form input elements in the HTML DOM correctly.

When I change the radio button selection, I don't see the collpase/
expand values sent to the server for the form input element. I can
verify the correct values using an alert function in my javascript, but
they are not getting written to the form input in the DOM and so not
seen/(sent to the) on server side too.
(Iam thinking once this 2nd radio button gets processed on the server,
some bad page is returned and thus making the problem show up. But I
don't see the problem with this button when I make my tree nodes
selectable. So iam looking for a hack in the javascript.)

The follwoing Code in my javascript writes the values to the form
input.

actionNameEnc is the name for the form input.
actionValue is the value that takes the values of tree collpase or
expand.
so the actionValue should be assgined to the actionNameEnc and returned
to the server.
<form ......>
<input type="hidden" value="actionNameEnc" name="actionNameEnc"
id="actionNameEnc"/>

<...javascript code....>
form[actionNameEnc].value = actionValue ;
alert(form[actionNameEnc].value); // this shows the correct
runtime value but is not seen in DOM
Can someone please suggest me some hack or workaround to make the value
that i see getting reflected in my javascript correctly to be seen also
in the DOM(value for the html form input) and thus could be sent back
to the server correctly.

Thanks in Advance to all..
Ravi.

Nov 14 '06 #1
7 1569

ravi wrote:
Hi,

I am a newbie to javascript.

Iam working on a page that has two radio buttons and a tree. I do not
have my tree nodes to be selectable.
Iam working on Firefox.
I have the firebug debugger attached.
Actually this is about a problem iam trying to debug. And found what
the problem is and iam looking for a hack/ workaround to fix the bug.

With one radio button selected and I working on the tree, the values
for actions of tree collapse or tree expand get sent to the server from
my javascript correctly. Before the page is submitted from javascript
to the server, I can see these collapse/ expand values reflected for my
form input elements in the HTML DOM correctly.

When I change the radio button selection, I don't see the collpase/
expand values sent to the server for the form input element. I can
verify the correct values using an alert function in my javascript, but
they are not getting written to the form input in the DOM and so not
seen/(sent to the) on server side too.
(Iam thinking once this 2nd radio button gets processed on the server,
some bad page is returned and thus making the problem show up. But I
don't see the problem with this button when I make my tree nodes
selectable. So iam looking for a hack in the javascript.)

The follwoing Code in my javascript writes the values to the form
input.

actionNameEnc is the name for the form input.
actionValue is the value that takes the values of tree collpase or
expand.
so the actionValue should be assgined to the actionNameEnc and returned
to the server.
<form ......>
<input type="hidden" value="actionNameEnc" name="actionNameEnc"
id="actionNameEnc"/>

<...javascript code....>
form[actionNameEnc].value = actionValue ;
alert(form[actionNameEnc].value); // this shows the correct
runtime value but is not seen in DOM
Can someone please suggest me some hack or workaround to make the value
that i see getting reflected in my javascript correctly to be seen also
in the DOM(value for the html form input) and thus could be sent back
to the server correctly.
no workaround needed! You just need to put the var you're assigning a
value to first!

actionValue = form[actionNameEnc].value;
alert(actionValue);

It should work!
>
Thanks in Advance to all..
Ravi.
Nov 14 '06 #2
Hi. thanks for the reply.
that doesn't help. I tried though. logs an error in the log.

May be I was not clear in the problem description.

'actionValue' is the parameter for my javascript function that takes
the rutime value of the tree collapse or expand.
And the paratmeter 'actionNameEnc'(or the form input name) need to be
assigned to this value.

Ravi.

Benjamin wrote:
ravi wrote:
Hi,

I am a newbie to javascript.

Iam working on a page that has two radio buttons and a tree. I do not
have my tree nodes to be selectable.
Iam working on Firefox.
I have the firebug debugger attached.
Actually this is about a problem iam trying to debug. And found what
the problem is and iam looking for a hack/ workaround to fix the bug.

With one radio button selected and I working on the tree, the values
for actions of tree collapse or tree expand get sent to the server from
my javascript correctly. Before the page is submitted from javascript
to the server, I can see these collapse/ expand values reflected for my
form input elements in the HTML DOM correctly.

When I change the radio button selection, I don't see the collpase/
expand values sent to the server for the form input element. I can
verify the correct values using an alert function in my javascript, but
they are not getting written to the form input in the DOM and so not
seen/(sent to the) on server side too.
(Iam thinking once this 2nd radio button gets processed on the server,
some bad page is returned and thus making the problem show up. But I
don't see the problem with this button when I make my tree nodes
selectable. So iam looking for a hack in the javascript.)

The follwoing Code in my javascript writes the values to the form
input.

actionNameEnc is the name for the form input.
actionValue is the value that takes the values of tree collpase or
expand.
so the actionValue should be assgined to the actionNameEnc and returned
to the server.
<form ......>
<input type="hidden" value="actionNameEnc" name="actionNameEnc"
id="actionNameEnc"/>

<...javascript code....>
form[actionNameEnc].value = actionValue ;
alert(form[actionNameEnc].value); // this shows the correct
runtime value but is not seen in DOM
Can someone please suggest me some hack or workaround to make the value
that i see getting reflected in my javascript correctly to be seen also
in the DOM(value for the html form input) and thus could be sent back
to the server correctly.
no workaround needed! You just need to put the var you're assigning a
value to first!

actionValue = form[actionNameEnc].value;
alert(actionValue);

It should work!

Thanks in Advance to all..
Ravi.
Nov 14 '06 #3
Can somebody please respond to this question/ problem.
Thank you.

ravi wrote:
Hi. thanks for the reply.
that doesn't help. I tried though. logs an error in the log.

May be I was not clear in the problem description.

'actionValue' is the parameter for my javascript function that takes
the rutime value of the tree collapse or expand.
And the paratmeter 'actionNameEnc'(or the form input name) need to be
assigned to this value.

Ravi.

Benjamin wrote:
ravi wrote:
Hi,
>
I am a newbie to javascript.
>
Iam working on a page that has two radio buttons and a tree. I do not
have my tree nodes to be selectable.
Iam working on Firefox.
I have the firebug debugger attached.
Actually this is about a problem iam trying to debug. And found what
the problem is and iam looking for a hack/ workaround to fix the bug.
>
With one radio button selected and I working on the tree, the values
for actions of tree collapse or tree expand get sent to the server from
my javascript correctly. Before the page is submitted from javascript
to the server, I can see these collapse/ expand values reflected for my
form input elements in the HTML DOM correctly.
>
When I change the radio button selection, I don't see the collpase/
expand values sent to the server for the form input element. I can
verify the correct values using an alert function in my javascript, but
they are not getting written to the form input in the DOM and so not
seen/(sent to the) on server side too.
(Iam thinking once this 2nd radio button gets processed on the server,
some bad page is returned and thus making the problem show up. But I
don't see the problem with this button when I make my tree nodes
selectable. So iam looking for a hack in the javascript.)
>
The follwoing Code in my javascript writes the values to the form
input.
>
actionNameEnc is the name for the form input.
actionValue is the value that takes the values of tree collpase or
expand.
so the actionValue should be assgined to the actionNameEnc and returned
to the server.
>
>
<form ......>
<input type="hidden" value="actionNameEnc" name="actionNameEnc"
id="actionNameEnc"/>
>
<...javascript code....>
form[actionNameEnc].value = actionValue ;
alert(form[actionNameEnc].value); // this shows the correct
runtime value but is not seen in DOM
>
>
Can someone please suggest me some hack or workaround to make the value
that i see getting reflected in my javascript correctly to be seen also
in the DOM(value for the html form input) and thus could be sent back
to the server correctly.
no workaround needed! You just need to put the var you're assigning a
value to first!

actionValue = form[actionNameEnc].value;
alert(actionValue);

It should work!
>
Thanks in Advance to all..
Ravi.
Nov 14 '06 #4
Not resolved yet. Someone Please.
Thank you.

ravi wrote:
Can somebody please respond to this question/ problem.
Thank you.

ravi wrote:
Hi. thanks for the reply.
that doesn't help. I tried though. logs an error in the log.

May be I was not clear in the problem description.

'actionValue' is the parameter for my javascript function that takes
the rutime value of the tree collapse or expand.
And the paratmeter 'actionNameEnc'(or the form input name) need to be
assigned to this value.

Ravi.

Benjamin wrote:
ravi wrote:
Hi,

I am a newbie to javascript.

Iam working on a page that has two radio buttons and a tree. I do not
have my tree nodes to be selectable.
Iam working on Firefox.
I have the firebug debugger attached.
Actually this is about a problem iam trying to debug. And found what
the problem is and iam looking for a hack/ workaround to fix the bug.

With one radio button selected and I working on the tree, the values
for actions of tree collapse or tree expand get sent to the server from
my javascript correctly. Before the page is submitted from javascript
to the server, I can see these collapse/ expand values reflected for my
form input elements in the HTML DOM correctly.

When I change the radio button selection, I don't see the collpase/
expand values sent to the server for the form input element. I can
verify the correct values using an alert function in my javascript, but
they are not getting written to the form input in the DOM and so not
seen/(sent to the) on server side too.
(Iam thinking once this 2nd radio button gets processed on the server,
some bad page is returned and thus making the problem show up. But I
don't see the problem with this button when I make my tree nodes
selectable. So iam looking for a hack in the javascript.)

The follwoing Code in my javascript writes the values to the form
input.

actionNameEnc is the name for the form input.
actionValue is the value that takes the values of tree collpase or
expand.
so the actionValue should be assgined to the actionNameEnc and returned
to the server.


<form ......>
<input type="hidden" value="actionNameEnc" name="actionNameEnc"
id="actionNameEnc"/>

<...javascript code....>
form[actionNameEnc].value = actionValue ;
alert(form[actionNameEnc].value); // this shows the correct
runtime value but is not seen in DOM


Can someone please suggest me some hack or workaround to make the value
that i see getting reflected in my javascript correctly to be seen also
in the DOM(value for the html form input) and thus could be sent back
to the server correctly.
no workaround needed! You just need to put the var you're assigning a
value to first!
>
actionValue = form[actionNameEnc].value;
alert(actionValue);
>
It should work!
>

Thanks in Advance to all..
Ravi.
Nov 14 '06 #5
VK

ravi wrote:
The follwoing Code in my javascript writes the values to the form
input.

actionNameEnc is the name for the form input.
actionValue is the value that takes the values of tree collpase or
expand.
so the actionValue should be assgined to the actionNameEnc and returned
to the server.
<form ......>
<input type="hidden" value="actionNameEnc" name="actionNameEnc"
id="actionNameEnc"/>

<...javascript code....>
form[actionNameEnc].value = actionValue ;
alert(form[actionNameEnc].value); // this shows the correct
runtime value but is not seen in DOM
I'm not clear on what do you mean by "seen in DOM". I hope it doesn't
mean "reflected in page source text" as it is not possible so your
attempt are futile. From what I got (correct me if I'm wrong):

document.forms["myForm"].elements["actionNameEnc"].value = actionValue;
alert (document.forms["myForm"].elements["actionNameEnc"].value);

That's with your form like
<form name="myForm" ....
....
<input type="hidden" name="actionNameEnc">
....

Nov 14 '06 #6
Hi. Thanks for the reply.

Iam having the firebug debugger as a plugin for firefox.
this tool shows the HTML DOM representation for the different html
elements of the page source. And shows the runtime values changing for
the html elements as i walk through the debugger.

In my javascript, I can verify the value of the form input Iam
modifying.
This iam able to print it out using the following alert.

window.document.forms[0][actionNameEnc].value = actionValue;
alert(window.document.forms[0][actionNameEnc].value);

But doesn't see those values geting reflected in the HTML DOM or the
runtime html code in the debugger.
Even after I submit the form using form.submit() in my javascript
function, the above alert() can print out the correct value but it is
not getting reflected in the HTML DOM/ code.

Even the code snippets that you have pasted does the same.
I have only one form in my html.

As I've described the problem in my first post, my scenario is with two
radio buttons and a tree(not selectable) on the page. With one radio
button, i see the HTML DOM(/ or the dynamic html code) getting updated
correctly as i walking through the debugger which was getting finally
sent(and seen) to the serverside correctly.
But with the other radio button the problem starts showing up, where
the wrong DOM is sent to the server side.

I know that the window, the document and the forms object in my alert
statements are part of the DOM, but though the DOM itself doesn't show
up the corect values.

Thanks again for working on my problem. .
Ravi.
VK wrote:
ravi wrote:
The follwoing Code in my javascript writes the values to the form
input.

actionNameEnc is the name for the form input.
actionValue is the value that takes the values of tree collpase or
expand.
so the actionValue should be assgined to the actionNameEnc and returned
to the server.
<form ......>
<input type="hidden" value="actionNameEnc" name="actionNameEnc"
id="actionNameEnc"/>

<...javascript code....>
form[actionNameEnc].value = actionValue ;
alert(form[actionNameEnc].value); // this shows the correct
runtime value but is not seen in DOM

I'm not clear on what do you mean by "seen in DOM". I hope it doesn't
mean "reflected in page source text" as it is not possible so your
attempt are futile. From what I got (correct me if I'm wrong):

document.forms["myForm"].elements["actionNameEnc"].value = actionValue;
alert (document.forms["myForm"].elements["actionNameEnc"].value);

That's with your form like
<form name="myForm" ....
...
<input type="hidden" name="actionNameEnc">
...
Nov 14 '06 #7
VK

ravi wrote:
Iam having the firebug debugger as a plugin for firefox.
this tool shows the HTML DOM representation for the different html
elements of the page source. And shows the runtime values changing for
the html elements as i walk through the debugger.
Firebug is a kappa-stage version of a 3rd party extension for Firefox.
So if it does show what is really happening then so is better; if it
says that Firefox is contacting the White House to start the 3rd World
War then just freely skip on this message. :-)

If my previously posted code didn't help you then forget of Firebug for
just a second and post the entire page you are working on (or an URL)
with exact comments on what property has to have what value.

Nov 14 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
2
by: Anthony | last post by:
I have an inventory database that Im trying to create a report out of the IP address are a lookup on a seperat table but I keep getting the above error can I change the table row to something to...
3
by: otto | last post by:
i need to read a variable in a javascript and translate it to a form in html the javascript variable is: <SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script> and i need to put that...
16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
0
by: Phadnis | last post by:
hi i am not gettin images when iam using a proxy for internet explorer.. iam building a vb.net application for this. plz give some code samples. also how to implement the RFC for my proxy to...
10
by: PH | last post by:
Hi guys! I need to get the remote EndPoint from when I receive packets when listening in a local port in my computer. I'm using UDP (connection-less) so I only bind the socket to my...
31
by: Kathy | last post by:
I would like to get the old and new value for a change made to a text box so that I can store them in a change history table. What is the best way to do this? I am just learning VB 2005; porting...
3
by: Rambaldi | last post by:
Wassup!!! <tr> <td> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <!-- Name of input element determines name...
3
by: waqasahmd | last post by:
Hi, I have this code in my pageload but the problem is i want rm_id which i am gettin from session should be set in the javascript code in place of 261 hard code value at line#5( var rmid = 261;) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.