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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax error...plz help

Status
Not open for further replies.

sourabhjha

Programmer
Jan 13, 2002
121
IN
my peice of code is like this.On run time i get an error saying "; expecxted"..can anyone help
function js_onFieldChange()
{
var form = this.document.forms[0];
form.EDITFLAG.value ="TRUE";
<% if (getServletContext().getAttribute(&quot;editflag&quot;) != null)
{
userinfo.remove(user+ &quot;~&quot; +dbLabel);
}
else
out.println(&quot;inside js else&quot;);
%>
//set app variable to yes
}


thanks in advance
-Sourabh
 
The code inside the &quot;<%&quot; and &quot;%>&quot; tags is server side code.
The code remaining is client side script. Call your page within a browser and call the &quot;view source&quot; feature of your browser, that'll show you what your server did with the server side script. To my mind, your problems comes when
Code:
getServletContext().getAttribute(&quot;editflag&quot;) == null
. In this case, viewed from client, your js function will look like :
Code:
function js_onFieldChange()
{
 var form = this.document.forms[0];
 form.EDITFLAG.value =&quot;TRUE&quot;;
 inside js else
 //set app variable to yes
}
Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top