codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  problem with eval function, please help me!  Archive Import (HAckLAsh) at 11:40 on Monday, August 11, 2003
 

this page bring me that error: missing ; before statement
what`s wrong?
here`s the code

<html>

<head>
<title>new page</title>
<SCRIPT LANGUAGE="Javascript">
function test(par)
{
alert(eval("document.formu." + par + "qtt.value"));
}
</SCRIPT>
</head>

<body>
<form name=formu>

<p><input type="text" name="1qtt" size="20"><input type="button" value="Button 1" name="B1" onclick=test("1")></p>
<p><input type="text" name="2qtt" size="20"><input type="button" value="Button 2" name="B2" onclick=test("2")></p>

</form>
</body>

</html>



  Re: problem with eval function, please help me!  Troy Wolf at 10:09 on Tuesday, August 12, 2003
 

I played with it for a couple minutes, and I`m not sure how to use the Eval statement and not get that error, but I always take the easy way out, and here is one easy way out:

alert(document.formu.elements[par + "qtt"].value);

Troy Wolf: site expert
SnippetEdit Website Editor


  Re: problem with eval function, please help me!  Elain at 08:09 on Friday, November 19, 2010
 

Althrough i can't help you solve the problom, you can try it carefully, i believe you will find the mistake which you made!
------------------------------------------------------------
flash banner|logo maker|flash menu|drop down menu








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  ASP.NET- is it possible to Restrict class
•  Re: File Formats
•  Re: very simple question
•  Re: title
•  Re: problem with eval function, please help me!
•  Re: I would like to put a column in an excel spreadsheet that reads +10/-10
•  Re: Common language searching....
•  The Internet in a Box-Widernet Project
•  Re: hi


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010