October 14th, 2010, 08:28 AM
VBscript Prime #'s in textbox?
Hi i'm writing a VBscript that should output all of Prime numbers inside a textbox.. so far i've been able to create a code that prints all of the prime number below 100 but im having a problem putting them inside the textbox... i dont have any idea on how to loop a texbox with different value..
heres my code:
sorry but i'm just a newbie on scripting...
For num = 3 To 100 Step 2
bIsPrime = True
For i = 2 To num\2
bIsPrime = num Mod i > 0
If Not bIsPrime then exit for
If bIsPrime Then
document.write(num & "<input type='text' size=10><br/>")
i need help on how to put the value i looped inside the textbox..
thanks for reading..
October 14th, 2010, 01:37 PM
I suspect you'll need to find the answer in a html/DOM oriented forum, structurally your vbscript appears correct.
The man who doesn't read good books has no advantage over the man who can't read them.
November 20th, 2010, 12:47 PM
Originally Posted by Vipe
if your function is working...
then the output can be added like this:
document.write( "<input type='text' size='10' value=''' & num & "'><br/>")