473,785 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.write sintax ?

Recently writing some code i cross over a problem using document.write:

The code
<input name="e2" size="20" type="text">
<select name="e1">
<option>....... ............... ............... ....
<option>Optio n1
</select>
<input src="picture.gi f" onclick="I()" align="right" type="image" width="60"
height="49"></p>

<script type="text/javascript">
function I()
{
if(e2.value=="" )
document.write( "Please input some words")
else if (e1.selectedInd ex==0)
document.write( "please choose some option")
}

The problem:

Is there a way to write this inside a div without using the innerHTML
command , or to fix the structure above, the current one dissapears using
document write , Thank you for all the atencion given to the subject.

Jul 23 '05 #1
2 1213
In article <41************ ***********@new s.telepac.pt>, of**@hotmail.co m
enlightened us with...

The problem:

Is there a way to write this inside a div without using the innerHTML
command , or to fix the structure above, the current one dissapears using
document write , Thank you for all the atencion given to the subject.


The DOM way is to use createElement and appendChild instead of
document.write.
Try those.

--
--
~kaeli~
Humpty Dumpty was pushed!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2

"kaeli" <ti******@NOSPA M.comcast.net> escreveu na mensagem
news:MP******** *************** *@nntp.lucent.c om...
In article <41************ ***********@new s.telepac.pt>, of**@hotmail.co m
enlightened us with...

The problem:

Is there a way to write this inside a div without using the innerHTML
command , or to fix the structure above, the current one dissapears using
document write , Thank you for all the atencion given to the subject.


The DOM way is to use createElement and appendChild instead of
document.write.
Try those.

--
--
~kaeli~
Humpty Dumpty was pushed!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Well I came up witH:

<script type="text/javascript">
e2=document.cre ateElement("<in put name='e2' size='20' type='text'
align='center'> ")
e1=document.cre ateElement('<se lect name="e1"
align="center"> <option>....... ..<option>optio n1</select>')
search=document .createElement( '<input src="picture.gi f" onclick="I()"
align="right" type="image" width="60" height="49">')

function I()
{
if(e2.value=="" )
e2.appendChild( "please insert text");
else if (e1.selectedInd ex==0)
e2.appendChild( "please insert an option")

somehow createElement do not create the input.

}
</script>
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2386
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of copying/pasting everytime I change it, I figure this will be better, as I only change it once. The problem is, document.write doesn't handle multiple lines very well, so I was wondering what is the best way to do this? Maybe there is even a better...
10
3299
by: Frits JK | last post by:
Hallo, I have to write a GUID to the register but I don't know to convert to hexadecimal. I have tried several things but I am shore that line 5 and 6 are not correct. //-------------------------------------------------------------------------- ---------- if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
1
1210
by: simon | last post by:
This works in VB: <td <%# myFunction(DataBinder.Eval(Container.DataItem,"column1"))%>> but in C# doesn't. What is the right sintax to include some text between the html tag in C#? I can't found. Thank you, S
7
1420
by: InuY4sha | last post by:
Hi all :) sorry.. I know this is a very mean question but I can't get the following couple of lines: static int dev_init(struct net_device *dev); struct net_device my_device = { init: dev_init, }; To me it looks something like defining a function and creating a structure that stores a label referencing that function.. what's the scope behind this ? Also I don't get the comma after "dev_init"... Can somebody explain me this sintax please...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10329
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7500
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.