Skip to Content
0
Former Member
Sep 04, 2004 at 08:09 AM

How to display the eror message in the iView

149 Views

Hi

I want to check the user input in the client side and display an error message in the iView instead of displaying the error message as an alert

it is ok when I tried to do it as an alert

alert('ERROR MESSAGE');

but the problem is how to display the error message as a text in the iView ...

I wrote the below code..

any one can see it and has any sugestion?

Thanks

=============

<%@ taglib uri="tagLib" prefix="hbj" %>

<%

String compid = "";

String message = "";

%>

<hbj:content id="MyContent">

<hbj:page title = "Selection Screen">

<hbj:form id = "myForm">

<br>

<br>

<br>

<center>

<H3>Benefits Statement </H3>

<H4>Selection Screen</H4>

<hbj:gridLayout

id="FSSLayout"

debugMode="False"

width="40%"

cellSpacing="5"

>

<hbj:gridLayoutCell

rowIndex="1"

columnIndex="1"

width="10%"

horizontalAlignment="LEFT"

style="WildStyle"

>

<hbj:label

id="label_inputPernr"

required="TRUE"

text="Personal Number:"

design="LABEL"

labelFor="inputPernr"

/>

</hbj:gridLayoutCell>

<hbj:gridLayoutCell

rowIndex="1"

columnIndex="2"

width="40%"

horizontalAlignment="LEFT"

>

<hbj:inputField id = "inputPernr"

>

<%

compid=MyContent.getParamIdForComponent(inputPernr);

%>

</hbj:inputField>

</hbj:gridLayoutCell>

<hbj:gridLayoutCell

rowIndex="10"

columnIndex="1"

width="40%"

horizontalAlignment="CENTER"

colSpan="2"

>

<hbj:button id = "myButton" text="Submit.." design="EMPHASIZED"

tooltip="Click me to submit this form" onClick="ClickEvent" onClientClick="validRequired()">

</hbj:button>

</hbj:gridLayoutCell>

</hbj:gridLayout>

</center>

<p font="Arial" size=20><%= message%></p>

</hbj:form>

<SCRIPT LANGUAGE="Javascript">

function validRequired()

{

var myvar = document.getElementById('<%=compid%>').value;

var ivID='<%=componentRequest.getComponentContext().getContextName()%>';

if (myvar = " ")

{

message = "Enter Employee Number";

ivuRefresh(ivID);

htmlbevent.cancelSubmit=true;

}

}

</SCRIPT>

</hbj:page>

</hbj:content>