creating HTML element dynamic 
Author Message
 creating HTML element dynamic

How about using createElement("BR") to create a couple of <BR>'s and then using appendAdjacentElement to place one after each span element...

You know you could have done all of this by building an HTML string of all three <input> elements (with ids) with <br>'s between and simply used one span.  You would insert the HTML you built into the span by assigning it to the span's innerHTML property or replace the span entirely by assigning the HTML it to it's outerHTML property.

--
Michael Harris


  I am tring to create a new INPUT TYPE="TEXT" dynamic (VBScript)
  I have used the createElement method to do that and the <span> to put it on
  the HTML,
  But when I want to put a line break after the <span> (in order to put a new
  element under another),
  It Does not do it
  What is the way to do it (To put the new Element whenever u want)?
  Here is the code:

  <HTML>
  <HEAD></HEAD>
  <TITLE></TITLE>
  <FORM NAME="FrmErr">
  <SCRIPT LANGUAGE=VBS>

   Sub TxtCreate()

    Dim ElementErrNum
    Dim ElementErrDesc
    Dim ElementErrReduce

    Set ElementErrNum=document.createElement("<INPUT TYPE=""text"" SIZE=10>" )
    Set ElementErrDesc=document.createElement("<INPUT TYPE=""text""
  SIZE=10>" )
    Set ElementErrReduce=document.createElement("<INPUT TYPE=""text""
  SIZE=10>" )

    ElementErrNum.name="txtNum" & document.all.length-12
    ElementErrDesc.name="txtDesc" & document.all.length-12
    ElementErrReduce.name="txtReduce" & document.all.length-12

    DataNum.appendChild (ElementErrNum)
    DataDesc.appendChild (ElementErrDesc)
    DataReduce.appendChild (ElementErrReduce)

   End Sub

  </SCRIPT>

  <BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
  LINK="#000000" VLINK="#808080" ALINK="#000000">
  <BLOCKQUOTE CLASS="body">

  Error Number Error Description Points Reduce<BR><HR>
  <SPAN ID="DataNum"></SPAN>
  <SPAN ID="DataDesc"></SPAN>
  <SPAN ID="DataReduce"></SPAN><BR>

  <INPUT TYPE="button" value="Add    " name=BtnCrt onclick=TxtCreate()>
  <INPUT TYPE="button" value="Submit " name=BtnSub onclick=TxtCreate()>
  <INPUT TYPE="button" value="Clear  " name=BtnClr
  onclick=TxtCreate()><BR><HR>

  </BLOCKQUOTE>
  </FORM>
  </BODY>
  </HTML>



Mon, 06 May 2002 03:00:00 GMT  
 creating HTML element dynamic
I am tring to create a new INPUT TYPE="TEXT" dynamic (VBScript)
I have used the createElement method to do that and the <span> to put it on
the HTML,
But when I want to put a line break after the <span> (in order to put a new
element under another),
It Does not do it
What is the way to do it (To put the new Element whenever u want)?
Here is the code:

<HTML>
<HEAD></HEAD>
<TITLE></TITLE>
<FORM NAME="FrmErr">
<SCRIPT LANGUAGE=VBS>

 Sub TxtCreate()

  Dim ElementErrNum
  Dim ElementErrDesc
  Dim ElementErrReduce

  Set ElementErrNum=document.createElement("<INPUT TYPE=""text"" SIZE=10>" )
  Set ElementErrDesc=document.createElement("<INPUT TYPE=""text""
SIZE=10>" )
  Set ElementErrReduce=document.createElement("<INPUT TYPE=""text""
SIZE=10>" )

  ElementErrNum.name="txtNum" & document.all.length-12
  ElementErrDesc.name="txtDesc" & document.all.length-12
  ElementErrReduce.name="txtReduce" & document.all.length-12

  DataNum.appendChild (ElementErrNum)
  DataDesc.appendChild (ElementErrDesc)
  DataReduce.appendChild (ElementErrReduce)

 End Sub

</SCRIPT>

<BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
LINK="#000000" VLINK="#808080" ALINK="#000000">
<BLOCKQUOTE CLASS="body">

Error Number Error Description Points Reduce<BR><HR>
<SPAN ID="DataNum"></SPAN>
<SPAN ID="DataDesc"></SPAN>
<SPAN ID="DataReduce"></SPAN><BR>

<INPUT TYPE="button" value="Add    " name=BtnCrt onclick=TxtCreate()>
<INPUT TYPE="button" value="Submit " name=BtnSub onclick=TxtCreate()>
<INPUT TYPE="button" value="Clear  " name=BtnClr
onclick=TxtCreate()><BR><HR>

</BLOCKQUOTE>
</FORM>
</BODY>
</HTML>



Tue, 07 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Create Array with Dynamic Elements

2. Create HTML Text Box Dynamic

3. Can you create an Object with Dynamic HTML

4. Can you create an Object with Dynamic HTML

5. Use dynamic references to form elements in VBA

6. referencing dynamic elements

7. dynamic control element name

8. Dynamic arrays that don't contain elements yet

9. Removing one element in dynamic array

10. How can i put elements in a dynamic array during run time

11. Referring to Dynamic form elements

12. dynamic IFRAME elements

 

 
Powered by phpBB® Forum Software