It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

please help me

please help me

Postby Santanu on Fri Jan 23, 2009 11:28 pm

I am generating an error message when the user enters an tnransmitter ID which is already assigned. The problem is when I reload this page the message still display on the page. But I want clear this error message when the page reload. Can somebody help me to clear this message.

Here is my modified code.
<%
XMLTagBean dup9450tag = new XMLTagBean();
String msg = "This TXID is assigned";
boolean isdup9450tag = false;
String testTx9450Value = "";

for ( int i = 0; i < testTxs.length; ++i )
{
if ( true == DeviceIDRange.t9450.equals( testTxs[i].type ) )
{
testTx9450Value = testTxs[i].txId;
System.out.println("The value of testTx9450Value1 is: " + testTx9450Value + "\n\n");
isdup9450tag = dup9450tag.isAssigned9450Tag( testTx9450Value );
System.out.println("The value of isdup9450tag is: " + isdup9450tag + "\n\n");
if ( true == isdup9450tag )
{
testTx9450Value = "";
System.out.println("The value of testTx9450Value2 is: " + testTx9450Value + "\n\n");
}
//testTx9450Value = "";
System.out.println("The value of testTx9450Value3 is: " + testTx9450Value + "\n\n");
}
else
if ( true == DeviceIDRange.tinov.equals( testTxs[i].type ) )
testTxInovValue = testTxs[i].txId;

}
%>

<%

if ( testTx9450Value.equals("") )
{
%>
<tr><td>&nbsp;</td></tr>
<tr>
<!-- The error text -->
<td>&nbsp;
<span class="error"><%=msg%></span>

</td>
</tr>
<%
//session.removeAttribute( "txid9450.setting.failure" );
}
%>

<% if ( true == is9450 ) {

if( false == isdup9450tag ) {

%>
<tr>
<td width="100px" align="center" class="input-style-4">
<input type="text" name="<%="testTx"+DeviceIDRange.t9450%>" class="input-style-3" value="<%=testTx9450Value%>" size="5" maxlength="5" onChange="testTxCheck( this );">
</td>
<td class="input-style-4">9450</td>
</tr>

<% } else {


%>

<tr>
<td width="100px" align="center" class="input-style-4">
<input type="text" name="<%="testTx"+DeviceIDRange.t9450%>" class="input-style-3" value="" size="5">
</td>
<td class="input-style-4">9450</td>
</tr>

<% }} else { %>
<input type="hidden" name="<%="testTx"+DeviceIDRange.t9450%>" value="">
<% } %>
Santanu
 
Posts: 16
Joined: Sat Aug 09, 2008 5:20 pm

Re: please help me

Postby rangana on Sat Jan 24, 2009 3:12 am

Your code doesn't seemed to be Javascript (as far as I could see).

Anyway, whatever language you are using, if it's a client-side script, run a function on page's load, and inside that function reset the value of the textbox by defining a "blank" value: ('')
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines


Who is online

Users browsing this forum: No registered users and 7 guests