Loading ...
Sorry, an error occurred while loading the content.

Re: javascript quiz

Expand Messages
  • zzzxtreme
    remember that true and false are reserved words use other names use conventions bFlag1 for boolean sName for string iCount for integer etc... ... appear
    Message 1 of 2 , Oct 5, 2003
    • 0 Attachment
      remember that true and false are reserved words
      use other names

      use conventions

      bFlag1 for boolean
      sName for string
      iCount for integer

      etc...

      --- In javascript_official@yahoogroups.com, ramble724 <no_reply@y...>
      wrote:
      > hi y'all, I'm trying to write a script so that a user can type his
      > answer in a textbox and the answer, either true or false will
      appear
      > in a textarea object. here is what I have as of now:
      >
      >
      > <script language="javascript">
      > function answer1(){
      > var yourAnswer=document.puzzle.first.value
      > var answer="24 hours in a day"
      > var true="true"
      > var false="false"
      > if(yourAnswer == answer){
      > document.puzzle.validate.value=true}
      > else {document.puzzle.validate.value=false}}
      >
      >
      > function reset(){
      > document.puzzle.first.value=document.puzzle.validate.value=""
      > }
      >
      > </script>
      > </HEAD>
      >
      > <BODY BGCOLOR="goldenrod" TEXT="#000000" LINK="#0000FF"
      > VLINK="#800080" ALINK="#FF0000">
      >
      > <form name="puzzle">
      > <p>1) 24 H in a D <input type="text" name="first"
      > value="">  <textarea wrap="virtual" name="validate"
      > cols="10" rows="1" value=""></textarea>
      >  <input type="button" value="Answer" onClick="answer1
      > ()"><input type="button" value="reset" onClick="reset()"></form>
      >
      > any help would be greatly appreciated
    Your message has been successfully submitted and would be delivered to recipients shortly.