www.webdeveloper.com
Results 1 to 5 of 5

Thread: Boxcount + 1 working fine, but need the box added at the top, not the bottom!

  1. #1
    Join Date
    Feb 2010
    Location
    England
    Posts
    122

    Boxcount + 1 working fine, but need the box added at the top, not the bottom!

    Code:
    Sub NBox
    	Set DCenter = document.getelementbyid("Centercontenta")
    	Set NDivC = document.createelement("Div")
    	Set NTextC = document.createelement("Textarea")
    	Set NInpC = document.createelement("Input")
    	set WLine = document.createelement("Hr")
    	Set HText = document.createtextnode("Heading:")	
    	Set Whitespace = document.createtextnode("  ")	
    	Set MText = document.createtextnode(" Main Information:")
    
    	wLine.color = "white"
    	NTextC.Rows = "10"
    	NtextC.Cols = "66"
    	NTextC.id = "centercontentT" & boxCount
    	NInpC.Maxlength = "100"
    	NInpC.size = "50"
    	NInpC.id = "centercontentH" & boxCount
    	NDivC.id = "centercontent" & boxCount
    	
    	DCenter.AppendChild NDivC	
    
    		set p = document.createelement("p")
    		p.AppendChild Htext
    		NDivC.AppendChild p
    
    		set p = document.createelement("p")
    		p.AppendChild NInpC
    		NDivc.AppendChild p
    
    		set p = document.createelement("p")	
    		p.AppendChild Mtext
    		NDivc.AppendChild p
    
    		set p = document.createelement("p")
    		p.AppendChild NTextC
    		NDivc.AppendChild p	
    	
    	Set aval = document.createtextnode(boxCount)
    
    	DCenter.AppendChild aval
    	DCenter.AppendChild WLine
    	
    	boxCount = boxCount + 1
    End Sub

    So obviously this script creates some new text boxes, but it currently creates the boxes at the bottom, after all the previously created boxes. So if we have:

    Box 1
    Box 2
    Box 3

    then it would add box 4 like so:

    Box 1
    Box 2
    Box 3
    Box 4




    How would I get it to view like this:

    Box 3
    Box 2
    Box 1

    And a new box (box 4) appear like this:

    Box 4
    Box 3
    Box 2
    Box 1


    Thank you in advance,

    Haze

  2. #2
    Join Date
    Feb 2011
    Location
    israel
    Posts
    157
    this is the javascript section. that doesn't look like javascript to me.
    my blog.

  3. #3
    Join Date
    Feb 2010
    Location
    England
    Posts
    122
    God forbid.

    Does VBscript go in the 'Other' section then? Because it doesn't actually list it anywhere, and it's as close to Javascript as anything.
    Regards,

    Haze

  4. #4
    Join Date
    Feb 2011
    Location
    israel
    Posts
    157

  5. #5
    Join Date
    Feb 2010
    Location
    England
    Posts
    122
    Merci.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles