By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,366 Members | 1,366 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,366 IT Pros & Developers. It's quick & easy.

'Innertext' to write in a table cell generated through HTML doesn't work in firefox

P: 1
hi,

I have a code where a value in one of a table cell needs to be populated on a command button click event.
Scenario:
There is a main window having multiple <DIV>s In one of the Div there is a table havind ID on a concerned cell (initially blank). The div also has a command button.
Now once the button is cliked, a popup window should open and the concerned cell (present in the main window) should be populated with a value.

code to write the text in the parent window cell:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('QuestCostofCapital').innerText = <%=TempCostofCapital%>
the variable TempCostofCapital has a proper value. I have verified thru alert().
This code works fine in IE but not in FireFox. i.e it populates the cell in IE bt leave the same in FireFox without any error.

Kindly provide me the solution.

prawasini
Oct 6 '07 #1
Share this Question
Share on Google+
5 Replies


P: 20
hi,

I have a code where a value in one of a table cell needs to be populated on a command button click event.
Scenario:
There is a main window having multiple <DIV>s In one of the Div there is a table havind ID on a concerned cell (initially blank). The div also has a command button.
Now once the button is cliked, a popup window should open and the concerned cell (present in the main window) should be populated with a value.

code to write the text in the parent window cell:

document.getElementById('QuestCostofCapital').inne rText = <%=TempCostofCapital%>
the variable TempCostofCapital has a proper value. I have verified thru alert().
This code works fine in IE but not in FireFox. i.e it populates the cell in IE bt leave the same in FireFox without any error.

Kindly provide me the solution.

prawasini
try innerHTML instead of innerText
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('QuestCostofCapital').innerHTML = <%=TempCostofCapital%>
Oct 6 '07 #2

FullyH3ktik
P: 52
have you tried using innerHTML instead of innerText?
because if it's working in IE but not in FF, you must have something wrong with your code
Oct 6 '07 #3

P: 20
have you tried using innerHTML instead of innerText?
because if it's working in IE but not in FF, you must have something wrong with your code
Try using innerText with mozilla It won't work but replace with innerHTML it would work
Oct 6 '07 #4

pbmods
Expert 5K+
P: 5,821
prawasini, Eyeinstyin:
Please use CODE tags when posting source code:

[CODE=javascript]
JavaScript code goes here.
[/CODE]
Oct 6 '07 #5

P: 6
hi,

I have a code where a value in one of a table cell needs to be populated on a command button click event.
Scenario:
There is a main window having multiple <DIV>s In one of the Div there is a table havind ID on a concerned cell (initially blank). The div also has a command button.
Now once the button is cliked, a popup window should open and the concerned cell (present in the main window) should be populated with a value.

code to write the text in the parent window cell:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('QuestCostofCapital').innerText = <%=TempCostofCapital%>
the variable TempCostofCapital has a proper value. I have verified thru alert().
This code works fine in IE but not in FireFox. i.e it populates the cell in IE bt leave the same in FireFox without any error.

Kindly provide me the solution.

prawasini


use textContent for innerText in FireFox
Oct 8 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.