Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > Re: insert java...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 16 Topic 35563 of 37128
Post > Topic >>

Re: insert javascrpt into textarea?

by Thomas 'PointedEars' Lahn <PointedEars@[EMAIL PROTECTED] > May 11, 2008 at 08:34 PM

globalrev wrote:
> i have a translator-program for the robbers language.

Your ****ft key is malfunctioning.

> i want the user to input into the topwindow and then display the
> encryption or decryption in the bottom window.
> 
> i am currently trying to do this via a python/webpy webapp but been
> told it can be done with javascript.
> 
> how would i do this? i couldnt figure it out from the w3schools
> tutorial.

That is unsurprising, as the W3Schools people apparently don't know HTML
themselves.  Avoid this site, it is not suitable as Web development
reference.

> and can i have a javascript to call another file? or i have to do the
> translation in the html-file below? it could get very cluttery...

What I had to read below is very far from being a "html-file".

> <html>
> <body bgcolor="orange">

`orange' is not a valid value for the deprecated `bgcolor' attribute.

http://www.w3.org/TR/REC-html40/types.html#h-6.5
http://validator.w3.org/

> <center>

CSS2 turns 10 tomorrow.

http://www.w3.org/TR/REC-html40/present/graphics.html#edef-CENTER

> <h1><p><b>Robber's language encrypter/decrypter!</b></p></h1>

Not Valid, the `p' element must not be contained in the `h1' element.

http://www.w3.org/TR/REC-html40/struct/global.html#edef-H1

> <form method=post>

Not Valid, the `action' attribute is required.

http://www.w3.org/TR/REC-html40/interact/forms.html#edef-FORM

>     <p>

Semantically wrong element, we are not talking paragraphs of text here. 
Use
`div' if you must.

http://www.w3.org/TR/REC-html40/struct/text.html#edef-P
http://www.w3.org/TR/REC-html40/struct/global.html#edef-DIV

>         <select name="encdec">

You should set the `size' attribute, too.

http://www.w3.org/TR/REC-html40/interact/forms.html#edef-SELECT

>             <option value="encrypt">encrypt</option>
>             <option value="decrypt">decrypt</option>
>         </select>
>     </p>
>         <textarea name="enc" rows="10" cols="50">
>         </textarea>
>     <p>
>         <input type="submit" value="submit" /><br />

You don't want to use XHTML.

http://hixie.ch/advocacy/xhtml
http://hsivonen.iki.fi/xhtml-the-point/

>     </p>
> </form>
> 
> <form method=post>

See above.

>     <textarea name="answer" rows="10" cols="50">
> 
>     </textarea>
> </form>

You don't want to submit this form's information, so you don't need a form
element here.

> </center>
> </body>
> </html>

As for your question, you can achieve optional client-side operation with

  <form action="..." onsubmit="return handleSubmit(this)">
    <script type="text/javascript">
      function handleSubmit()
      {
        ...

        // if successful
        return false;
      }
    </script>
  </form>

But I strongly suggest you learn HTML first.


PointedEars
-- 
    realism:    HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness:    XHTML 1.1 as application/xhtml+xml
                                                    -- Bjoern Hoehrmann
 




 16 Posts in Topic:
insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 07:31:51 
Re: insert javascrpt into textarea?
Thomas 'PointedEars' Lahn  2008-05-11 20:34:21 
Re: insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 13:29:50 
Re: insert javascrpt into textarea?
Thomas 'PointedEars' Lahn  2008-05-11 23:17:14 
Re: insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 15:04:16 
Re: insert javascrpt into textarea?
Thomas 'PointedEars' Lahn  2008-05-12 00:17:34 
Re: insert javascrpt into textarea?
Thomas 'PointedEars' Lahn  2008-05-12 01:50:13 
Re: insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 15:51:03 
Re: insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 17:01:23 
Re: insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 17:33:21 
Re: insert javascrpt into textarea?
Thomas 'PointedEars' Lahn  2008-05-12 04:02:24 
Re: insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 19:39:53 
Re: insert javascrpt into textarea?
Thomas 'PointedEars' Lahn  2008-05-12 04:46:43 
Re: insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 20:05:52 
Re: insert javascrpt into textarea?
globalrev <skanemupp@[  2008-05-11 20:44:43 
Re: insert javascrpt into textarea?
Dr J R Stockton <jrs@[  2008-05-12 13:03:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 14:53:19 CDT 2008.