XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Posttop
Saurabh KhareSubject: Regd, entering text in the text box.
Author: Saurabh Khare
Date: 13 Mar 2008 05:09 AM
Originally Posted: 13 Mar 2008 05:06 AM
Hi,
I am slightly new to XSL. I am now building the XSl file where in that
"When the user enters the cust id, & clicks on the search link , that XSL will search whether the user record is present or not.Similarly the clear link will clear the cust id text box."

But Its not allowing me to enter any text inside the text box.When I click in the text box, the drop down list comes which shows all the text entered previously.If I select that text ,then appln.is working properly. Any ideas ???

Please find below the code ::

LOok for the code where I have created the label & text box for Primary cusomer ID & seatrch & clear link.


<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:space="default" version="1.0">
<xsl:output doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" method="html" indent="yes" />
<xsl:template match="/">
<html>
<head>
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=ISO-8859-1"/>
<meta HTTP-EQUIV="no-cache"/>
<link REL="STYLESHEET" TYPE="text/css" HREF="css/{faml/css/@perscss}"/>
<link REL="STYLESHEET" TYPE="text/css" HREF="css/{faml/css/@langcss}"/>
<script language="JavaScript" src="jsdir/{faml/mci/@langid}/common.js" type="text/JavaScript" ></script>
<title>Customer Download </title>
<script language="JavaScript" type="text/JavaScript">

function fireAppSearch()
{

/*if (document.frmChoose.fldCustomerName.value != "") {
if (! validateInp (document.frmChoose.fldCustomerName.value, "desc")) {
"Invalid characters in Customer Name field, please enter again.");
document.frmChoose.fldCustomerName.focus ();
return false;
}
}*/
// "fireAppSearch");
if (document.frmChoose.fldPCustId.value == "") {

document.frmChoose.fldPCustId.focus ();
"Enter Customer ID .");
return false;
}

document.frmpost.fldCustIdSrch.value = document.frmChoose.fldPCustId.value;
// document.frmpost.fldCustDescSrch.value = document.frmChoose.fldCustomerName.value;
document.frmpost.fldCustSearchFlag.value = "true";
document.frmpost.fldScrnSeqNbr.value = "01";
document.frmpost.target = "_self";
document.frmpost.submit ();
return false;
}
//------------------------------------------------------------------------------
function clear_val () {

// "clear_val");
document.frmChoose.fldPCustId.value="";
// document.frmChoose.fldCustomerName.value="";


return false;

}
//------------------------------------------------------------------------------
function downloadclick()
{


// "downloadclick");

if(document.frmpost.fldPCustId.value =="") {

return false;
}
document.frmpost.fldScrnSeqNbr.value = "02";
document.frmpost.target="_self";
document.frmpost.submit ();
return false;

}
//------------------------------------------------------------------------------
function idselected(p_cust_id)
{

// "idselected");
document.frmpost.fldPCustId.value = p_cust_id;
}
//------------------------------------------------------------------------------
function closeWindow()
{

//" closeWindow");
window.close();
}
//------------------------------------------------------------------------------
</script>
</head>
<body dir="LTR" class="WorkArea">
<form name="frmpost" action="entry" method="post">
<input type="hidden" name="fldCustIdSrch" id="idfldCustIdSrch"/>
<input type="hidden" name="fldCustDescSrch" id="idCustDescSrch"/>
<input type="hidden" name="fldPCustId" id="idfldPCustId"/>
<input type="hidden" name="fldCustSearchFlag" id="idfldCustSearchFlag" value="false"/>
<xsl:apply-templates select="faml/mci"/>
</form>

<form name="frmChoose" method="post" action="entry">
<table class="TableCenterAlign" width="90%" >
<tr>
<td width="100%" class="PageHeading">
Download Customer
</td>
</tr>
</table>
<br/>
<xsl:apply-templates select="faml"/>
<br/>
</form>
</body>
</html>
</xsl:template>
<xsl:template match="faml">
<table width="90%" cellspacing="0" cellpadding="4" class="TableBorder" align="center">
<caption class="ColHeadingLeftAlignedBold">search criteria</caption>
<tr>
<td width="20%" class='DataLeftAlignedBold'>
<label for="idfldPCustId">Primary Customer ID</label>
</td>

<td class="DataLeftAlignedBold" width="30%">
<input id="idfldPCustId" value="{faml/searchcondition/custid}" size="25" maxLength="50"
name="fldPCustId" type="text" onkeypress__="return fireAppSearch()" />
</td>
<!--
<td width="30%" class='DataLeftAlignedBold'>
<input type="text" maxlength="10" name="fldPCustId" onkeypress__="return fireAppSearch()"
size="20" value="{searchcondition/custid}" id="idfldPCustId"/>
</td>
-->


<td class='DataLeftAlignedBold'>
<label for="idfldPCustId1" > </label>
</td>
<td class='DataLeftAlignedBold'>
<input type="hidden" name="fldPCustId1" size="1" value="{searchcondition/custid}" id="idfldPCustId1"/>
</td>


<!-- <td width="20%" class='DataLeftAlignedBold'><label for="idfldCustomerName">Customer Name</label></td>
<td width="30%" class='DataLeftAlignedBold'>
<input type="text" name="fldCustomerName" maxLength="50"
size="20" value="{searchcondition/custdesc}" id="idfldCustomerName"/>
</td>-->
</tr>
</table>
<br/>
<table class="TableCenterAlign" width="90%">
<tr>
<td width="50%" class="NavBold">
<a href="JavaScript:void(0)" onclick__="return fireAppSearch()" onkeypress__="return fireAppSearch()" title="search" accesskey="F" class="NavBold">search</a>
</td>
<td width="50%" class="NavBold">
<a href="JavaScript:void(0)" onclick__="return clear_val()" onkeypress__="return clear_val()" title="clear" accesskey="L" class="NavBold">clear</a>
</td>
</tr>
</table>
<br/>
<table width="90%" class="TableBorder" cellspacing="2" cellpadding="2">
<xsl:if test="(searchcondition/custid) != ''
or (searchcondition/custdesc) != ''">
<caption class="ColHeadingLeftAlignedBold" >
search condition
</caption>
</xsl:if>
<xsl:if test="searchcondition/custid!=''">
<tr>
<th width="50%" class='DataLeftAlignedBold'>customer id</th>
<td width="50%" class='DataLeftAligned'>
<xsl:value-of select="searchcondition/custid"/>
</td>
</tr>
</xsl:if>
<xsl:if test="searchcondition/custdesc!=''">
<tr>
<th width="50%" class='DataLeftAlignedBold'>Customer Name</th>
<td width="50%" class='DataLeftAligned'>
<xsl:value-of select="searchcondition/custdesc"/>
</td>
</tr>
</xsl:if>
</table>
<br/>
<xsl:if test="response/customerlist/customer">
<table width="90%" class="TableBorder" cellspacing="2" cellpadding="2">
<caption class='DataLeftAlignedBold'>
List of Customers
</caption>
<thead>
<tr>
<th width="30%" class='ColHeadingLeftAlignedBold'>customer id</th>
<th width="30%" class='ColHeadingLeftAlignedBold'>customer description</th>
<th width="30%" class='ColHeadingLeftAlignedBold'></th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="response/customerlist/customer"/>
</tbody>
</table>
<xsl:if test="not (updateScreenFlag)">
<br/>
<xsl:if test="response/countexceed">
<table width="90%" class="TableBorder" cellspacing="2" cellpadding="2" >
<tr>
<td class='Warning' width="80%">
<xsl:value-of select="response/countexceed"/>
</td>
</tr>
</table>
</xsl:if>
</xsl:if>
<br/>
</xsl:if>
<xsl:if test="response/norecfound">
<br/>
<table width="90%" class="TableBorder" cellspacing="2" cellpadding="2">
<tr>
<td class="Warning" width="100%">
No Customer ID(s) is(are) found to be downloaded from the host system.
</td>
</tr>
</table>
</xsl:if>
<xsl:if test="not (updateScreenFlag)">
<br/>
<xsl:if test="response/customerlist/customer">
<table class="TableCenterAlign" width="90%">
<tr>
<td width="90%" class='NavBold'>
<a href="JavaScript:void(0)" title="download" accesskey="D" onkeypress__="return downloadclick ()" onclick__="return downloadclick ()">
download
</a>
</td>
</tr>
</table>
</xsl:if>
</xsl:if>
<xsl:if test="(updateScreenFlag)">
<br/>
<table width="90%" class="TableBorder" cellspacing="2" cellpadding="2">
<tr>
<td class="DataCenterAlignedBold" width="100%">
record inserted in LDB
</td>
</tr>
</table>
<!--table class="TableCenterAlign" width="90%">
<tr>
<td width="90%" class='NavBold'>
<a href="JavaScript:void(0)" title="Close Window" accesskey="D" onkeypress__="return closeWindow ()" onclick__="return closeWindow ()">
Close Window
</a>
</td>
</tr>
</table-->
</xsl:if>
<br/>
<table class="TableCenterAlign" width="90%">
<tr class="AlterRow2">
<td width="100%" class="DataCenterAlignedBold">End of Page</td>
</tr>
</table>
</xsl:template>

<xsl:template match="response/customerlist/customer">
<xsl:variable name="style">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">Alterrow2</xsl:when>
<xsl:otherwise>Alterrow1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$style}">
<td class='DataLeftAlignedBold'>
<xsl:if test="not (/faml/updateScreenFlag)">
<input type="radio" name="fldSelPCustId" value= '{@custid}' onclick__="idselected('{@custid}')"/>
</xsl:if>
<xsl:value-of select="@custid" />
</td>
<td class='DataLeftAligned'>
<xsl:value-of select="@custdesc" />
</td>
<td class='DataLeftAligned'>
<xsl:if test="@downloaded = 'Y'">
Already Downloaded
</xsl:if>
</td>
</tr>
</xsl:template>


<xsl:template match="mci">
<input type="hidden" name="fldAppId" value="{@appid}" id="idfldAppId"/>
<input type="hidden" name="fldTxnId" value="{@txnid}" id="idfldTxnId"/>
<input type="hidden" name="fldLangId" value="{@langid}"/>
<input type="hidden" name="fldDeviceId" value="{@deviceid}"/>
<input type="hidden" name="fldScrnSeqNbr" value="{@scrnseqnbr}" id="idfldScrnSeqNbr"/>
<input type="hidden" name="fldSessionId" value="{@sessionid}" id="idfldSessionId"/>
<input type="hidden" name="fldRequestId" value="{@requestid}" id="idfldRequestId"/>
</xsl:template>

</xsl:stylesheet>
<!--***************************************************************************
**
** End of file
**
****************************************************************************-->





 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.