473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Add the input text and display below

Hi,

I'm trying to create a function that allows me to append the character at input text and display them on the div tag below. But the screen shouldn't refresh, therefore I'm using AJAX.

But I can't seem to get it done, not really familiar with AJAX. Wonder if anyone here can help me out.
Below is the code:

Expand|Select|Wrap|Line Numbers
  1. <HTML>
  2. <HEAD>
  3. <TITLE>Stock Count Task Generation</TITLE>
  4. <SCRIPT LANGUAGE='javascript1.2'>
  5. function addOwner(id, val) {
  6.         var objOutput = document.getElementById(id);
  7.         objOutput.innerHTML = val;
  8. }                                   
  9. </SCRIPT>
  10.  
  11. </HEAD>
  12. <BODY>
  13. <FORM ACTION="WWW_WMS_SCNT.PROC_SCNT" METHOD="POST" name="form1">
  14. <TABLE >
  15. <TR>
  16. <TD>
  17. <INPUT TYPE="text" NAME="in_owner_code2" id="test1" class="defaultText" SIZE="10" MAXLENGTH="10" onFocus="window.status='Select the Owner Code'; return true;" onBlur="window.status=''; return true;">
  18. <INPUT TYPE="button" VALUE="Add" class="smallButton" onClick="addOwner(in_owner_code_range,this.form.in_owner_code2.value);" name="owner_code_range_add">
  19. </TD>
  20. </TR>
  21. <TR>
  22. <TD>
  23. <DIV ID="in_owner_code_range"></DIV>
  24. </TD>
  25. </TR>
  26. </TABLE>
  27. </BODY>
  28. </HTML>
  29.  
Apr 4 '07 #1
3 3208
acoder
16,027 Expert Mod 8TB
Firstly, this is not Ajax, just simple DHTML.

The mistake in your code is that the id should be a string:
[HTML]<INPUT TYPE="button" VALUE="Add" class="smallButton" onClick="addOwner('in_owner_code_range',this.form. in_owner_code2.value);" name="owner_code_range_add">[/HTML]
Feb 5 '08 #2
Firstly, this is not Ajax, just simple DHTML.

The mistake in your code is that the id should be a string:
[HTML]<INPUT TYPE="button" VALUE="Add" class="smallButton" onClick="addOwner('in_owner_code_range',this.form. in_owner_code2.value);" name="owner_code_range_add">[/HTML]

Thanks for your help.
Feb 29 '08 #3
acoder
16,027 Expert Mod 8TB
You're welcome (even though I replied after, what, 10 months!) ;)
Feb 29 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Corepaul | last post by:
As input is typed into a text box, I would like to search a recordset for the first record that matches what has been typed so far. I would like to update the text box to display the letters typed...
1
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this...
2
by: magix | last post by:
Hi, I'm using Access Database with ASP. There is one particular thing that I have issue with. My purpose is for user to update their own profile. Their existing profile information will be...
1
by: Csaba Gabor | last post by:
Short version: if the user types an alt+ctrl+char combination which leads to a defined character, but s/he's not in a input(text)/textarea, then I'd like that keystroke combination to do the same...
1
by: S. David Kyle | last post by:
I am having a weird issue when I generate an input Html tag from a Xsl transformation. When the trasform is executed on the xsl below, the <inputtag has the closing slash removed in the first...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
11
by: Mike Harrison | last post by:
Hi, I have some simple HTML like this: <div id="container" style="width:100%;"> <input type="text" <input type="button" style="float:right;" value="Click here..."> </div> I want the button...
1
by: sandeep kumar shah | last post by:
Hi, We have used a file uploading HTML tag in an HTML page. We need to customize the text displayed on the Button (which is by default “Browse…” for internet explorer). Below is the...
2
by: perhapscwk | last post by:
My code below, I can add and remove textbox, however, it can add/remove the last one only. How I can add a input textbox between field? thanks. my html file <script...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.