Jochen Ismer wrote:
> Hi Rolf,
> thanks for the help but it also doesn't work. I get an Error Message:
> object expected for the line.
> Jochen
>
> 2007/3/16, Rolf Huehne < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>>:
>
>     Jochen Ismer wrote:
>     > Hello Everybody,
>     > i want to have a textfield in which the user can type the number of
>     > the amino acid he wants to choose. My code was something like that,
>     > but it doesn't work:
>     >
>     >  <SCRIPT >
>     >     function test() {
>     >     var x = document.myform.eingabe.value
>     >     jmolscript( 'select x;')
>     > }
>     > </SCRIPT>
>     >
>     > <input type="text" name = "eingabe" >
>     >   <input type="button" value="select AS"
>     >       onClick="test ()">
>     >
>     I think the problem is variable substitution. In the part
>     "jmolscript('select x;')" 'x' will not be substituted by the value of
>     variable 'x'.
>
>     If you would use "jmolscript('select ' + x + ';')" instead, the
>     variable
>     substitution should be done.
>
Since you were not very specific in your problem description I started
with the most obvious error.

It might be sufficcient to add a ';' to the line before "jmolscript...",
but I would reference the value of your input field in a different way:

var x = document.getElementById("eingabe").value;

This would require also to change the "input" tag definition to

<input type="text" id="eingabe">

If this doesn't help it would be best if you could provide an URL with
the complete example page.

Regards,
Rolf


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to