ramareddyj
asked on
how to write an error message on a jsp by calling a js function from jsp
hi ,
i am facing the problem of showing an error message on a jsp page once the user clicks a link.
The error message is to be shown on the same page where the link is shown.
the code is as below
(<html:link href="#" onclick="document.write(in dexEnableI nMatch('pm formforind exing'))">
<bean:message bundle="POIMatches" key="pmr.details.link" />
</html:link>)
not abel to understand what code should i write on the the event onClick?
kindly help me
regards,
jatinder
i am facing the problem of showing an error message on a jsp page once the user clicks a link.
The error message is to be shown on the same page where the link is shown.
the code is as below
(<html:link href="#" onclick="document.write(in
<bean:message bundle="POIMatches" key="pmr.details.link" />
</html:link>)
not abel to understand what code should i write on the the event onClick?
kindly help me
regards,
jatinder
ASKER
i am using struts framework. and i have decide to show the error message in a textbox which will be disabled all the time
what i am trying to do now is on execution of following line
onclick="indexEnableInMatc h(<%='pmfo rmforindex ing'%>)">
my indexEnableInMatch() will be called and inside this function i am going to set the value of a text box to my error message
function indexEnableInMatch(FormNam e)
{
alert(FormName);
FormName.hiddenLabel.value ="my error emssage ";
}
now i am facing problem in passing the parameter "pmformforindexing" which is nothing but my action form.
any way to resolve this??
regards,
jatinder
what i am trying to do now is on execution of following line
onclick="indexEnableInMatc
my indexEnableInMatch() will be called and inside this function i am going to set the value of a text box to my error message
function indexEnableInMatch(FormNam
{
alert(FormName);
FormName.hiddenLabel.value
}
now i am facing problem in passing the parameter "pmformforindexing" which is nothing but my action form.
any way to resolve this??
regards,
jatinder
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
can i make the text color "RED" for a disabled text box?????
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>>>> input="NameOfJSP"
I meant input="NameOfJSP.jsp"
I meant input="NameOfJSP.jsp"
If you want it to display an error message w/o a page refresh(another request-responce cycle),
then you need some DHTML, like swapping layers in and out via javascript.
Let me know which way you are trying to go.