473,800 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="actionNa meEnc" name="actionNam eEnc"
id="actionNameE nc"/>

<...javascrip t 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 1589

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="actionNa meEnc" name="actionNam eEnc"
id="actionNameE nc"/>

<...javascrip t 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(actionVal ue);

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="actionNa meEnc" name="actionNam eEnc"
id="actionNameE nc"/>

<...javascrip t 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(actionVal ue);

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="actionNa meEnc" name="actionNam eEnc"
id="actionNameE nc"/>
>
<...javascrip t 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(actionVal ue);

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="actionNa meEnc" name="actionNam eEnc"
id="actionNameE nc"/>

<...javascrip t 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(actionVal ue);
>
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="actionNa meEnc" name="actionNam eEnc"
id="actionNameE nc"/>

<...javascrip t 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["actionName Enc"].value = actionValue;
alert (document.forms["myForm"].elements["actionName Enc"].value);

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

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.do cument.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="actionNa meEnc" name="actionNam eEnc"
id="actionNameE nc"/>

<...javascrip t 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["actionName Enc"].value = actionValue;
alert (document.forms["myForm"].elements["actionName Enc"].value);

That's with your form like
<form name="myForm" ....
...
<input type="hidden" name="actionNam eEnc">
...
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
14158
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 uninitialized value in concatenation (.) at register.pl line 38, <STDIN> line 10." The PERL code is as follows:
2
7140
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 fix this or what. SELECT i.INVENTORY_ITEM_ID AS ,i.HOST_NAME AS , '' AS Flag, i.MEMO AS Comments, 'Seattle' AS City, 'Washington' AS State, CASE WHEN fv.value = 'EL EET1410' THEN '1111 3rd Ave.' WHEN fv.value = 'EL WFL17' THEN '999 3rd Ave.'...
3
18241
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 variable as the value in this line <input type="hidden" name="AMT" value="**">
16
11501
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 an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base = document.frmKitAmount.txtTotalKitValue.value; margin = document.frmKitAmount.margin.value/100;
0
1030
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 work. iam very new to socket programming. n this task is urgent.. reply asap.. thks...
10
6964
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 localEndPoint, I do not Bind(), Connect() to a RemoteEndPoint.
31
21880
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 an application from MS Access where I could just use the TextBox.OldValue construct. TIA, Kathy
3
1267
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 in $_FILES array --> <font size='3' face='Tahoma' color="black"> Localização:&nbsp;&nbsp; <input type="file" name="userfile" /><br> </td>
3
3952
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;) i use concatination opr but it dose'nt work out. int rm_id = Convert.ToInt32(Session); //var rmid = <%= Convert.ToInt32(Session) %> string updateParentScript = @"function updateParentWindow() {...
0
9555
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10514
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10260
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10042
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4156
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3770
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2956
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.