473,413 Members | 1,727 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,413 software developers and data experts.

how to put div id content inside a input box in html page

45
hello everyone,

i need your help.
i m using ajax to retrieve value from database and showing it within html form insise div tag .its working well.But now i need to show div id content(field value from database) inside a input box.i m using onchange event.

how to do it ?
can any one please help me out.

Thanks
Aug 2 '08 #1
5 7819
acoder
16,027 Expert Mod 8TB
The only difference is instead of innerHTML (which is what I assume you used for the div), use value to set the text box.
Aug 2 '08 #2
boss1
45
The way you have suggested is not working for me. i willbe happy if you give me an example. here i have given some code of me.Try to give a soluation from it.
Expand|Select|Wrap|Line Numbers
  1.  
  2. This is my ajax code:
  3. if (ObjectName=="PARTY_CODE")
  4.          {
  5.  document.getElementById("txtHint2").innerHTML=xmlHttp.responseText 
  6.          }
This is where i want to show value:
[HTML] <td width ="10%" align =left><td><div id="txtHint2"></div></td>[/HTML]

txthint2 Contain the party name against party code.

now i want to show value of" txtHint2" inside a input box or text box ,sothat i can send it to database.
so what do do with it? please help me
Aug 3 '08 #3
acoder
16,027 Expert Mod 8TB
If your input box is marked up like this:
[html]<input type="text" id="test" name="test">[/html]then to change/set its value:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("test").value = "whatever value you want to set here...";
Aug 3 '08 #4
boss1
45
Hi acoder,

Thank you so much. Your given idea is working properly.

i have spent a lot days for it.But i could'nt now it's working.

Tank u so much again
Aug 4 '08 #5
acoder
16,027 Expert Mod 8TB
You're welcome. That's what we're here for ;)
Aug 4 '08 #6

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

Similar topics

12
by: jonathan.beckett | last post by:
Hi All, For the past few months I have been working on an open source Apache/PHP/MySQL content management system - and have recently made it available for download. It's still very much a...
0
by: jonathan.beckett | last post by:
Hi All, I have just made version 0.4.8 of the PluggedOut CMS Content Management System available for download - it's free, and covered by the GPL. It's still very much a work in progress...
4
by: christine.nguyen | last post by:
Hello, Here's the deal. I have an html page that contains an iframe. This iframe has an id that is unknown to me. This iframe also has test.html as it's source. Within test.html runs some...
7
by: Andrew Robinson | last post by:
Given HTML text (likely from SQL), is there any method that could be employed to render server and/or custom controls that are contained inside of that text? I would be loading content from a...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
5
by: =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= | last post by:
Hello, I've been trying to figure something out for the past few days and I can't seem to pinpoint what I'm doing wrong. I've been trying to call javascript from inside a <logic:equal>, but...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
8
by: josephman1988 | last post by:
What i want to do, is have content on a homepage, which can be edited via a form on a restricted page. E.G. I have news on home page, when i go to a restricted page (e.g. mysite.co.uk/admin) i...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.