Results 1 to 4 of 4
- 05-14-2010, 02:44 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 9
- Rep Power
- 0
Help Needed in Solving the Following Isuue.
Hi,
I am working on a task, which has a text box and on exit of a text box we need to get the remaing content, for example in google when we start wrting some letter in the text box we will be getting all related content which starts with that perticular letter, As of now we are not calling any ajax methods.
here is the code which i am working on:
<script type="text/javascript">
function getContentByText(element){
var text = element.value;
var response = getEmailAddresses(text);
processResponseTable(response);
}
function getEmailAddresses(text)
{
//send input text as part of ajax request
//once the ajax is posted,we can get the response
//response will be as shown below which we then process
var testString="test@google.com; att@att.com; vz@verizon.com; test2@gmail.com; note@gmail.com";
return testString;
}
function processResponse(text){
var addresses = testString.split(';');
if(addresses){
var temp='';
for(var i=0; i<addresses.length ; i++){
temp = temp+addresses[i];
temp = temp+'\n';
}
var nextelement = document.getElementById("2email");
nextelement.value = temp;
}
}
function processResponseTable(textString){
alert(textString);
var addresses = textString.split(';');
if(addresses){
alert(addresses);
var temp='<table>';
for(var i=0; i<addresses.length ; i++){
temp = temp+'<tr><td>';
temp = temp+addresses[i];
temp = temp+'</td</tr>';
}
temp = temp+'</table>';
var nextelement = document.getElementById("results");
if(nextelement){
alert("nextelement");
}
nextelement.innerHTML = temp;
}
}
</script>
<table>
<tr><td id="bodyText" nowrap colspan="2"><input type="radio" name="catagory" checked="checked" value="CAN" >CAN <input type="radio" name="catagory" value="PCAN" >PCAN <input type="radio" name="catagory"value="BTN" >BTN <input name="TEXT" onblur="getContentByText(this)" type="text" size="20"</td></tr>
<tr><td id="bodyText" nowrap>To Email/Fax <span id="requiredText" >*</span></td>
<td id="bodyText" align="right"><input name="TO_EMAIL" type="text" size="36" value="<%=emailID %>" ></td></tr></table>
In the above code we are having a text box with size 20. when we type letter a and exit of tht we need to get all the related data in to the To Email/Fax text box. in this case we will get att@verizon.com
if t we need to test@gmail.com and test2@gmail.com
when i type any letter i am getting all the content, no matter which letter it starts with.
Thank you in advance.
- 05-14-2010, 03:25 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
I see no Java...
- 05-14-2010, 03:37 PM #3
Member
- Join Date
- Jan 2010
- Posts
- 9
- Rep Power
- 0
Ya, it just got the text boxes in html whih calls a function, usually we will get those deatils using AJAX but we dont have tht functionality right now. so our main thing is how do we get the specfic content with the above code. As i mentioned.
- 05-14-2010, 05:01 PM #4
Similar Threads
-
Solving a Maze
By bdario1 in forum New To JavaReplies: 4Last Post: 04-14-2010, 12:02 AM -
I need help solving this problem.
By Felicia in forum New To JavaReplies: 5Last Post: 03-04-2010, 08:40 PM -
Pls help me in solving this java question
By dunnoGUy in forum New To JavaReplies: 1Last Post: 02-28-2010, 07:10 AM -
4x4 2D array card game,need solving
By highschool in forum New To JavaReplies: 6Last Post: 02-25-2010, 03:36 PM -
I need a help in solving this method using vectors
By java_fun2007 in forum New To JavaReplies: 2Last Post: 11-26-2007, 07:51 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks