codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Validation Problem  sanny6136 at 05:31 on Sunday, July 16, 2006
 

Hi Guys,

I want to write afuncion to get the text boxes dynamically if the message contains PX(index of PX).
i have written a function but i m getting a a text box if the the message doesnt contain any index of PX.

the sample code as follows..

<script>
var htmlstr='';
function populate(par) {


var param;
var count=0;
var currNode;
htmlstr='';
XMLID.async = false;
XMLID.load("/forum/getdata_rtype_.html"+par);

objNodeList = XMLID.getElementsByTagName("MSG");
if(objNodeList.length>0){
document.f1.msg.value = objNodeList.item(0).text;
}
objNodeList = XMLID.getElementsByTagName("PARAM");
if(objNodeList.length>0){
param = objNodeList.item(0).text;
var sparam=param.split(",");
if(sparam.length>0){
var msgs=document.f1.msg.value;
var s=0;
var e=0;
for(var i=0;i<sparam.length;i++){
e=msgs.indexOf('PX'+sparam.toUpperCase());
htmlstr+=msgs.substring(s,e)+"<input type=text name='"+sparam+"'>";
s=e+sparam.length+2;

}
htid.innerHTML=htmlstr;
}
}


}

<body>
<tr>
<td width="268"><b>
<font face="Verdana" color="#4D6EB0" size="2">
Shortcode</font></b></td>
<td width="181">
<select size="1" name="shortcode" onChange="return populate(this.value)" style="color: #4D6EB0; font-size: 10pt; font-family: Verdana; font-weight: bold">
<option selected value="SELECT">---Select Shortcode---
</option>
<% while(rs.next()){%>
<option value="<%=rs.getString(1)%>"><%=rs.getString(1)%></option>
<%}%>
</select></td>
</tr>

<div id="htid"></div>


any suggestins?
Thanks in advance
Santhosh








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: C++ Beginner question
•  Re: function within loop problem
•  moncler outlet
•  Re: Display swf file in pdf
•  Re: how to create forum using asp.net with c# language?
•  Discount coach store
•  Create Better Maps with Global Mapper
•  Re: How to display a message box when record is temporary stored in session/grid view
•  Sharing object in perl


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012