Click here to Skip to main content
15,844,903 members
Home / Discussions / Web Development
   

Web Development

 
QuestionJavascript Password Generator Pin
fryguy.ca20-Mar-07 18:16
fryguy.ca20-Mar-07 18:16 
AnswerRe: Javascript Password Generator Pin
Bradml20-Mar-07 23:50
Bradml20-Mar-07 23:50 
GeneralRe: Javascript Password Generator Pin
fryguy.ca21-Mar-07 11:40
fryguy.ca21-Mar-07 11:40 
GeneralRe: Javascript Password Generator Pin
Bradml22-Mar-07 14:13
Bradml22-Mar-07 14:13 
QuestionIIS ASP Encrypt Utility Pin
Vasudevan Deepak Kumar20-Mar-07 13:55
Vasudevan Deepak Kumar20-Mar-07 13:55 
QuestionC++ dll accessed by COld Fusion Pin
LCI20-Mar-07 9:08
LCI20-Mar-07 9:08 
QuestiongSoap dime attachments Pin
abac_mefisto20-Mar-07 6:23
abac_mefisto20-Mar-07 6:23 
QuestionJavascript, innerHTML and Firefox Pin
JoiSteingrims20-Mar-07 6:14
JoiSteingrims20-Mar-07 6:14 
Hi everyone

Here is a test page with dynamic function who adds combo box or text box to the form when the user press the + button. There is also a - button who deletes the last box from the list.

In IE when adding value to innerHTML property the changes does not affect previous values, but in Firefox the innerHTML is set to initial state, loosing the user input.

Can anyone tell me if it is possible rewrite this function for Firefox?

<html>
<head>
<script language=javascript>
function ruPanelMultiAdd(sName) {
var sHTML = '';
sHTML = document.getElementById('src'+sName).innerHTML
document.getElementById('div'+sName).innerHTML += sHTML;
}
function ruPanelMultiDelete(sName, sToken) {
var sHTML = '';
var sLower = '';
sHTML = document.getElementById('div'+sName).innerHTML;
sLower = sHTML.toLowerCase();
sHTML = sHTML.substr(0, sLower.lastIndexOf(sToken) );
document.getElementById('div'+sName).innerHTML = sHTML;
}
</script>
</head>
<body>
<form >
<table border='1' align='center' cellspacing='0' cellpadding='0'><tr><td nowrap>
<div id='srcDepartment' nowrap>
<select size='1' name='Department' ID='Department' onblur="this.setAttribute('value',this.value);">
<option value ='14' >Aaaa</option>
<option value ='5' >Bbbb</option>
<option value ='27' >Cccc</option>
<option value ='15' >Dddd</option>
</select>
<br />
</div>
</td><td colspan=2>
<a href="javascript:ruPanelMultiAdd('Department');">[+]</a>
<a href="javascript:ruPanelMultiDelete('Department','<select');">[-]</a>
</td></tr><tr><td colspan=2 nowrap>
<div id='divDepartment'></div>
</td></tr><tr><td>
<div id='srcsGrantor' nowrap>
<input type='text' name='sGrantor' onblur="this.setAttribute('value',­ this.value);">
<br />
</div>
</td><td colspan=2>
<a href="javascript:ruPanelMultiAdd('sGrantor');">[+]</a>
<a href="javascript:ruPanelMultiDelete('sGrantor','<input');">[-]</a>
</td></tr><tr><td colspan=2 nowrap>
<div id='divsGrantor'></div>
</td></tr></table>
</form>
</body>

AnswerRe: Javascript, innerHTML and Firefox Pin
Guffa20-Mar-07 11:07
Guffa20-Mar-07 11:07 
AnswerRe: Javascript, innerHTML and Firefox Pin
JoiSteingrims21-Mar-07 14:19
JoiSteingrims21-Mar-07 14:19 
QuestionStarting Application Pin
Navneet Hegde20-Mar-07 4:03
Navneet Hegde20-Mar-07 4:03 
AnswerRe: Starting Application Pin
Laxman Auti21-Mar-07 6:56
Laxman Auti21-Mar-07 6:56 
QuestionWindows Authentication Pin
nclauder20-Mar-07 3:48
nclauder20-Mar-07 3:48 
JokeRe: Windows Authentication Pin
Laxman Auti21-Mar-07 6:58
Laxman Auti21-Mar-07 6:58 
GeneralRe: Windows Authentication Pin
nclauder21-Mar-07 22:43
nclauder21-Mar-07 22:43 
GeneralRe: Windows Authentication Pin
Laxman Auti21-Mar-07 23:03
Laxman Auti21-Mar-07 23:03 
GeneralRe: Windows Authentication Pin
nclauder22-Mar-07 0:26
nclauder22-Mar-07 0:26 
Questioncalling session["id"] from javascript Pin
haytham_mohammad20-Mar-07 1:27
haytham_mohammad20-Mar-07 1:27 
AnswerRe: calling session["id"] from javascript Pin
WoutL20-Mar-07 1:51
WoutL20-Mar-07 1:51 
GeneralRe: calling session["id"] from javascript Pin
haytham_mohammad20-Mar-07 12:46
haytham_mohammad20-Mar-07 12:46 
GeneralRe: calling session["id"] from javascript Pin
WoutL20-Mar-07 22:49
WoutL20-Mar-07 22:49 
AnswerRe: calling session["id"] from javascript Pin
Vasudevan Deepak Kumar20-Mar-07 7:20
Vasudevan Deepak Kumar20-Mar-07 7:20 
GeneralRe: calling session["id"] from javascript Pin
haytham_mohammad20-Mar-07 12:48
haytham_mohammad20-Mar-07 12:48 
AnswerRe: calling session["id"] from javascript Pin
RichardGrimmer22-Mar-07 7:18
RichardGrimmer22-Mar-07 7:18 
QuestionDraw dynamic Line Polyline polygon on firefox Pin
AnhTin19-Mar-07 18:33
AnhTin19-Mar-07 18:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.