Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Create Controls at runtime on Client in vbscript

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,399
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Create Controls at runtime on Client in vbscript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Create Controls at runtime on Client in vbscript - 9/25/2001 8:43:05 PM   
  Triemer

 

Posts: 3
Score: 0
Joined: 9/16/2001
From: Australia
Status: offline
No one in our office is been able to solve my problem!
I am new to the industry (on work experience)
and would appreciate any help I can get.
Client enters an integer to produce a number of textboxes to enter data that will be saved to sqlServer7. MY PROBLEM?
I am trying to use the innerHTML method but I get an error: An exception of type 'htmlfile: Unknown runtime error' Was not handled. Am I on the right track? or could you suggest an alternative?
Many Thanks In Advanced.

<%@ Language=VBScript%>

<% ' VI 6.0 Scripting Object Model Enabled %>
<!--#include file="_ScriptLibrary/pm.asp"-->
<% if StartPageProcessing() Then Response.End() %>
<FORM name=thisForm METHOD=post>
<HTML>
<TITLE>Dynamic Textboxes NOW!!</TITLE>
<HEAD>
<META name=VI60_defaultClientScript content=VBScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

<META content="Microsoft Visual Studio 6.0" name=GENERATOR>
<SCRIPT DEFER language=VBScript>
<!-- Option Explicit

Dim strTDWidth, strTxtBoxStyle, strStableTag, strEtable
strTDWidth="width=25%"
strTxtBoxStyle=" style=HEIGHT=18px WIDTH=98%"
strStableTag = "<TABLE width=100%>"
strEtableTag = "</TABLE>"

Private Sub txtPersonnel_onBlur()
numQtyIn = thisForm.txtPersonnel.value
strNameIn = "txtName"
strDutiesIn = "txtDuties"
call CreateMultiTextBoxes(strNameIn,strDutiesIn, numQtyIn)
End Sub

Private Sub CreateMultiTextBoxes(strNameIn,strDutiesIn, numQtyIn)
Dim i, strTemp, strNewHTML, numTxtBoxes

if thisForm.txtPersonnel.value > 2 then
numTxtBoxes= int(document.thisForm.txtPersonnel.value/2)
if (thisForm.txtPersonnel.value mod 2)=1 then
numTxtBoxes=numTxtBoxes+1
end if
For i=2 to numTxtBoxes
strTemp = strTemp & "<TR><TD" & " " & strTDWidth & ">"
strTemp = strTemp & "<INPUT id=" & strNameIn & i
strTemp = strTemp & " " & strTxtBoxStyle & " " & "Type=Text></TD>"
strTemp = strTemp & "<TD" & " " & strTDWidth & ">"
strTemp = strTemp & "<INPUT id=" & strDutiesIn & i
strTemp = strTemp & " " & strTxtBoxStyle & " " & "Type=Text></TD>"

strTemp = strTemp & "<TD" & " " & strTDWidth & ">"
strTemp = strTemp & "<INPUT id=" & strNameIn & i
strTemp = strTemp & " " & strTxtBoxStyle & " " & "Type=Text></TD>"
strTemp = strTemp & "<TD" & " " & strTDWidth & ">"
strTemp = strTemp & "<INPUT id=" & strDutiesIn & i
strTemp = strTemp & " " & strTxtBoxStyle & " " & "Type=Text></TD></TR>"
next
strNewHTML = strTemp '& strEtableTag strStableTag &
tbl3.innerHTML= strNewHTML
else

exit sub
end if
tblOne.innerHTML= strNewHTML
End Sub

-->
</SCRIPT>

      
      
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Create Controls at runtime on Client in vbscript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts