Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html to javascript

Status
Not open for further replies.

cfprg

Programmer
Apr 14, 2004
38
US

var toDisplay = "<select name=&#34;sigDuration&#34; onChange=&#34;changeDuration(this)&#34;>"

the above is in javascript function..the onchange event doesn't work at all..
any ideas...!
 
How are you "using" this lne of code?

I suggest, for one, you use backslashes.

var toDisplay = "<select name=\"sigDuration\" onChange=\"changeDuration(this);\">";

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
I was using backslash before and also tried it again..but it doesn't work..the following is my function..

function changeDurationToDropDown()
{
var hidSigDuration = eval(formName).hidSigDuration.value
hidSigDuration = hidSigDuration.split(";")
var toDisplay = "<select name=\"sigDuration\" onChange=\"changeDuration(this);\">";
toDisplay = toDisplay + "<option value=''></option>"
toDisplay = toDisplay + "<option value='9999'>Text</option>"
for(var i=0;i<hidSigDuration.length;i++)
{
if (eval(formName).hidDefSigDuration.value == hidSigDuration)
toDisplay = toDisplay + "<option selected value='" + hidSigDuration + "'>" + hidSigDuration +"</option>"
else
toDisplay = toDisplay + "<option value='" + hidSigDuration + "'>" + hidSigDuration +"</option>"
}
toDisplay = toDisplay + "</select>"
DurationDiv.innerHTML = toDisplay
eval(formName).hidSigDurationFlag.value = "D"
}

 
the above code is the one i wrote for pocket pc..it works fine with desktop..but it doesn't for pocket pc..
any ideas..:)

thanks...
 
maybe u ushould use single qoutes?

var toDisplay = "<select name='sigDuration' onChange='changeDuration(this);'>";

Known is handfull, Unknown is worldfull
 
Or... use the regular quotes surrounded by single quotes...

Code:
var toDisplay = '<select name="sigDuration" onChange="changeDuration(this);">';

Jeff
 
Hi guys,

Thanks a lot for the quick responses. Unfortunately, i tried various ways with quotes either single or double..but none of them worked(though it obviously works on my desktop but not on pocket pc)..i think this is due to pocket pc's limited support for javascript..now i have to find other ways to make this work..let me know if u guys have any other ideas...thanks again..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top