/    Sign up×
Community /Pin to ProfileBookmark

problem with innerhtml

hi all,

i am developing an application in struts and javascript.
i am creating a layer and then i am trying to insert a combobox in it.

the reason why i am creating a separate layer for each control is that i want the elements to be draggable.

the code is:

var cod = document.cbe.createElement(“DIV”);//i have a createElement() method for cbe for creating a layer
cod.cbe.innerHtml(‘<html:select name=”employeeForm” property=”mycombo” onchange=”pass(this.options[this.selectedIndex].value)”>
<html:options collection=”mycombo” property=”id” labelProperty=”description”/>
</html:select>
‘);

the error i get is :unclosed string literal.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliSep 17.2003 — this should work

cod.cbe.innerHtml('<html:select name="employeeForm" property="mycombo" onchange="pass(this.options[this.selectedIndex].value)">'+

'<htmlptions collection="mycombo" property="id" labelProperty="description"/></html:select>');
Copy linkTweet thisAlerts:
@sandu_adaauthorSep 18.2003 — hi Khalid,

I tried your way but still getting the error as

unterminated string literal at

+'<option value="1">Red</option>


Actually the struts code

<html:options collection="mycombo" property="id" labelProperty="description"/>

gets transformed into html as:

<option value="1">Red</option>
<option value="2">Blue</option>

where Red,Blue etc are the elements of the collection mentioned above.

How to rectify this error.

regards,
Sandhya
Copy linkTweet thisAlerts:
@Khalid_AliSep 18.2003 — always post the complete part of the code that is in question and is causing error...so that I or some one else for tat matter can take a look..:-)
×

Success!

Help @sandu_ada spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...