Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Textbox isnt an object problem

    Every time i try to run this script, it says that vname isnt an object. whats this mean?? Im trying to make a script that'll take the information from different inputs and arrange them in a message to e-mail to a certain recipiant. When i try to make the message come together, gives me an error message saying vname isnt an object. WHAT AM I DOING WRONG!?

    <script language="javascript">
    function message(form) {
    nam=form.vname.value
    date=form.dotw.value
    hour=form.Hour.value
    phr=form.ParH.value
    AMP=form.AMP.value
    pnum=form.pnumber.value
    email=form.email.value
    form.message.value="Hi Jim, it's " + nam + ". I wanted to schedule a lesson on " + date + " at " + hour + ":" + phr + " " + AMP + "/n/n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -" + nam + "/n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " + pnumber + "/n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " + email
    }
    </script>





    Here is the form where all of the inputs are located.






    <form name="form" method="POST" action="--WEBBOT-SELF--">
    <p>Your Name: <input type="text" name="vname" size="20"></input></p>
    </form>

    there is actually alot more to the form but i didnt want to post it all... i can post it tho.
    Last edited by Borommakot; 06-09-2004 at 09:03 PM. Reason: Correct title

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You do not show how you are calling the function.

    onsubmit="message(this)"

  • #3
    New Coder
    Join Date
    May 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    o sorry, its a button

    <input type="button" onclick="message()" value="Create" name="Message">

    heh, ima newbie to these forms sorry

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to pass the form thru the function.

    onclick="message(this.form)"

    But it would be best to use a submit button and the onsubmit I previously posted.

  • #5
    New Coder
    Join Date
    May 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    DOH! i totally forgot lol, thanks. The submit that u posted, does that mail Just whats in the "message" text area? or the whole form?

    Uh Oh... it says error
    line 119
    object doesnt support this property or method

    but i dont have a line 119, just 70 lines
    Last edited by Borommakot; 06-09-2004 at 09:16 PM.

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The whole form. Which question leads be to assume that you are using more than one form and your "button" is in a different form. If so, that is your problem, but I am not going to continue to play twenty questions and/or guess.

    Good Luck....

  • #7
    New Coder
    Join Date
    May 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope, im using just one form, and you could have the whole code if u want. but i dont think you want that. i still dont see how you assume that im using more than one form...

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Please post the whole code

  • #9
    New Coder
    Join Date
    May 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    o i got it working, nvm, but i'll show u the code, tell me what i did wrong plz. should i have called the function by

    onchange="message(this.form)"

    or

    onkeypress="message(this.form)"

    anyway, heres the code if u wanna tell me what i did wrong plz.


    (btw this was a form to schedule lessons from a guy named jim )









    <HTML>
    <head>
    <title>
    Schedule Lessons
    </title>
    <script language="javascript">
    function Message(form) {
    nam=form.vname.value
    date=form.dotw.value
    hour=form.Hour.value
    phr=form.ParH.value
    AMP=form.AMP.value
    pnum=form.pnumber.value
    email=form.email.value
    form.message.value="Hi Jim, it's " + nam + ". I wanted to schedule a lesson on " + date + " at " + hour + ":" + phr + " " + AMP + "/n/n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -" + nam + "/n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " + pnumber + "/n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " + email
    }
    </script>
    </head>
    <body bgcolor="#FFFFFF">
    <p>Schedule Lessons: </p>
    <form name="FrontPage_Form1" method="POST" action="--WEBBOT-SELF--" onsubmit="message(this)">
    <!--webbot bot="SaveResults" U-File="../_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" i-checksum="43374" endspan -->
    <p>Your Name: <input type="text" name="vname" size="20"></input></p>
    <p>Your E-Mail Address: <input type="text" name="email" size="20"></p>
    <p>Your Phone Number:
    <input type="text" name="pnumber" size="20" value="(559) ___-____"></p>
    <p>What day of the week did you want your lesson on?<!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="1" b-disallow-first-item="TRUE" --><select size="1" name="dotw">
    <option>&lt;Select a day of the Week&gt;</option>
    <option>Monday</option>
    <option>Tuesday</option>
    <option>Wednesday</option>
    <option>Thursday</option>
    <option>Friday</option>
    <option>Saturday</option>
    <option>Sunday</option>
    <option>Any Week Day</option>
    <option>Any Week End Day</option>
    <option>Any Day</option>
    </select> (You may select more than one if more than one choice appeals to
    you by holding down ctrl and clicking on the second, third, fourth, or fifth option.)</p>
    <p>What time do you prefer?<!--webbot bot="Validation" b-disallow-first-item="TRUE" --><select size="1" name="Hour">
    <option>&lt;Select Hour&gt;</option>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    <option>11</option>
    <option>12</option>
    </select>:<!--webbot bot="Validation" b-disallow-first-item="TRUE" --><select size="1" name="ParH">
    <option>&lt;Select part of the hour&gt;</option>
    <option>00</option>
    <option>30</option>
    </select> <!--webbot bot="Validation" b-disallow-first-item="TRUE" --><select size="1" name="APM">
    <option>&lt;select AM or PM&gt;</option>
    <option>AM</option>
    <option>PM</option>
    </select></p>
    <p>Your message looks like this:</p>
    <p><textarea rows="5" name="Message" cols="78"></textarea></p>
    <p><input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="Reset"><input type="button" onclick="Message(this.form)" value="create Message" name="Create"></p>
    </form>
    </body>
    </HTML>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •