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
    Regular Coder
    Join Date
    Nov 2003
    Location
    Seattle
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JS working fine, now not working

    I have a JS that I use for a quiz and sumbission information comes back to me via Bravenet. Everything has been working fine, but today I tested it and now it does not submit my information back to me. I have not changed a thing!

    I contacted Bravenet and they say "You can not have a form within a form". I don't understand, this worked for months.

    Here is the code:
    <html>
    <head>
    <title>January Quiz</title>
    <script type="text/javascript" src="quizconfig.js"></script>
    <script type="text/javascript">
    <!--//
    function setCookie() {
    duit = new Date();
    duit.setTime(duit.getTime() + 30*24*60*60*1000);
    var expString = "; expires=" + duit.toGMTString();
    document.cookie = document.title + expString;
    }

    function submitData() {
    var dc = document.cookie;
    if(dc.match(document.title)) {
    notice = "Thank You for your interest in taking our "+document.title+".\n";
    notice+= "BUT, YOU MAY ONLY SUBMIT THE TEST ONE TIME!\n";
    notice+= "You will now be redirected to Our Home Page.\n";
    alert(notice);
    window.location.replace('/');
    }
    else {
    var correct = document.result.CORRECT.value;
    var sub = correct+ ' correct answers on your '+document.title+'!';
    var name = document.thedata.NAME.value;
    if (!name) {
    alert('You must enter your name');
    document.thedata.NAME.focus();
    return false;
    }
    else {
    document.senddata.NAME.value = name;
    }
    var contact = document.thedata.CONTACT.value;
    if (!contact) {
    alert('You must enter your e-mail address');
    document.thedata.CONTACT.focus();
    return false;
    }
    else {
    document.senddata.CONTACT.value = contact;
    }
    var from = document.thedata.FROM.value;
    if (!from) {
    from = 'No Data Submitted';
    document.senddata.FROM.value = from;
    }
    else {
    document.senddata.FROM.value = from;
    }
    var comment = document.thedata.COMMENT.value;
    if (!comment) {
    comment = 'No Comments Made.';
    document.senddata.COMMENT.value = comment;
    }
    else {
    document.senddata.COMMENT.value = comment;
    }
    document.senddata.PERCENTAGE.value = document.result.q.value;
    document.senddata.CORRECT_ANSWERS.value = document.result.p.value;
    document.senddata.WRONG_ANSWERS.value = document.result.T2.value;
    document.senddata.action="http://pub7.bravenet.com/emailfwd/senddata.php"
    document.senddata.submit();
    }
    }
    // -->
    </script>
    </head>

    <body bgcolor="#FFFFFF" onunload="setCookie()">
    <p align="center"><strong><font face="Arial">
    <big>Instant Quiz Results</big></font></strong></p>

    <div align="center">
    <center>
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%">
    <form name="result">
    <input type="hidden" name="CORRECT" value="">
    <table border="0" width="100%" cellpadding="0" height="116">
    <tr>
    <td height="25" bgcolor="#DBE0F5"><strong><font face="Arial"># of questions you got right:</font></strong></td>
    <td height="25"><p><input type="text" name="p" size="24"></td>
    </tr>
    <tr>
    <td height="17" bgcolor="#DBE0F5"><strong><font face="Arial">The questions you got wrong:</font></strong></td>
    <td height="17"><p><textarea name="T2" rows="3" cols="24" wrap="virtual"></textarea></td>
    </tr>
    <tr>
    <td height="25" bgcolor="#DBE0F5"><strong><font face="Arial">Grade in percentage:</font></strong></td>
    <td height="25"><input type="text" name="q" size="8"></td>
    </tr>
    </table>
    </form>
    </td>
    </tr>
    </table>
    </center>
    </div>

    <div align="center">
    <center>
    <p>
    <script type="text/javascript">
    var wrong=0
    for (e=0;e<=2;e++)
    document.result[e].value=""

    var results=document.cookie.split(";")
    for (n=0;n<=results.length-1;n++){
    if (results[n].charAt(1)=='q')
    parse=n
    }

    var incorrect=results[parse].split("=")
    incorrect=incorrect[1].split("/")
    if (incorrect[incorrect.length-1]=='b')
    incorrect=""
    document.result[1].value=totalquestions-incorrect.length+" out of "+totalquestions
    document.result[3].value=(totalquestions-incorrect.length)/totalquestions*100+"%"
    for (temp=0;temp<incorrect.length;temp++)
    document.result[2].value+=incorrect[temp]+", "
    correct = totalquestions-incorrect.length;
    document.result.CORRECT.value = correct;
    </script>
    <form name="thnx">
    <input type="button" value="Submit your answers by entering your information below" name="B1" onClick="location.replace('/');">
    </form>


    <!-- Start Bravenet.com Service Code -->
    <div align=center>

    <div style="border:1px solid #999999; width:255px; margin-bottom:5px;background-color:#F2F4FA;">
    <form name="senddata" method="post" enctype="multipart/form-data" style="margin:0px;">
    <input type="hidden" name="NAME" value="" />
    <input type="hidden" name="CONTACT" value="" />
    <input type="hidden" name="FROM" value="" />
    <input type="hidden" name="COMMENT" value="" />
    <input type="hidden" name="PERCENTAGE" value="" />
    <input type="hidden" name="CORRECT_ANSWERS" value="" />
    <input type="hidden" name="WRONG_ANSWERS" value="" />
    <input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
    <input type="hidden" name="usernum" value="587815930" />
    <input type="hidden" name="cpv" value="2" />
    </form>

    <div style="background-color:#DBE0F5; padding:3px; font:12px arial; color:black;">
    <b>Your Answers will submit automatically when you complete this form</b>
    </div>

    <form name="thedata">
    <div style="padding:10px; font: normal 12px Arial; text-align:left;">
    What is your name?<br />
    <input type="text" name="NAME" size="34" style="width:230px;" /><br />
    E-mail address?<br />
    <input type="text" name="CONTACT" size="34" style="width:230px;" /><br />
    Where are you from?<br />
    <input type="text" name="FROM" size="34" style="width:230px;" /><br />
    Any Comments?<br />
    <input type="text" name="COMMENT" size="34" style="width:230px;" /><br />
    </form>
    </div>

    <div align="center">
    <form name="datasubmit">
    <input type="button" name="send" value=" Submit" onClick="submitData()">
    <input type="button" name="reset" value=" Clear " onClick="document.thedata.reset();">
    </form>
    </div>

    <div align="center" style="margin:10px;">
    <a style="font: bold 10px tahoma,arial; text-decoration: none;"
    href="http://www.bravenet.com" target="_new">
    powered&nbsp;by&nbsp;<img src="http://images.bravenet.com/bravenet/images/poweredby.gif"
    border="0" align="absmiddle" alt="Powered by Bravenet" />&nbsp;bravenet.com</a>
    </div>

    </div>
    </div>
    <!-- End Bravenet.com Service Code --></div>

    <p id="footnote" align="center"><font face="arial" size="-1">Quiz script provided by<br>
    <a href="http://www.javascriptkit.com">JavaScriptKit.com</a></font></p>
    </body>
    </html>


    Thanks in advance for your input!
    www.dreamsonthefly.com/januaryquiz.html
    Dreams on the Fly
    http://www.dreamsonthefly.com

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Rhonda;

    I just tried submitting the form thru the Bravenet account I had set up when we first worked on this. Out of 5 submittals the results for the second submittal was immediately forwarded to my contact address. The other four appear to be somewhere in cyberspace.

    Anyways, the results of my testing is that it appears the form is being submitted to Bravenet. BTW: there is not a form within a form as Bravenet indicated. I had originaly coded the form the way I did because Bravenet would display the 'hidden' fields on their confirmation page, which was not what we wanted.

    Below is what Bravenet forwarded in regards to the second submittal. The test results are blank because I bypassed taking the test.

    Code:
    MESSAGE SENT THROUGH YOUR WEBSITE
    
    This form was submitted:  Jan 31 2004 / 12:35:43
    by a visitor with this IP Address:  xx.xxx.xxx.xxx
    
    NAME = bbbbbbbb
    CONTACT = bbbbbbbbb
    FROM = bbbbbbbb
    COMMENT = bbbbb
    PERCENTAGE = 
    CORRECT_ANSWERS = 
    WRONG_ANSWERS = 
    userid = xxxxxxxx
    
    
    Thank you for using Bravenet Email Form Processing!
    I'll let you know if the other test results are recieved.
    In the meantime, I would suggest looking for another form mailer. Preferably one which can be used serverside on your domain.

    .....Willy

  • #3
    Regular Coder
    Join Date
    Nov 2003
    Location
    Seattle
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    They are messed up

    Hey Willy! Nice to hear from you, hope you are warm and cozy!

    Bravenet first says the form within a form then they say:

    Dear Dreamsonthefly,

    The Email Form code you posted in this ticket is broken and incorrect coding. You will have to rebuild your form with form the code I gave you.

    Member [Dreamsonthefly] January 31, 2004 12:07:47
    I'm sorry I don't understand what I am to do with what you just sent me.

    Bravenet Web Services Support [Doug - Support Technician] January 31, 2004 12:05:07
    Was this reply helpful?
    Dear Dreamsonthefly,

    Here is a working copy of your Email Form code:

    <!-- Start Bravenet.com Service Code -->
    <div align="center">
    <div style="border:1px solid #999999; width:255px; margin-bottom:5px;background-color:#F2F4FA;">
    <form action="http://pub7.bravenet.com/emailfwd/senddata.php" method="post" enctype="multipart/form-data" style="margin:0px;">
    <div style="background-color:#DBE0F5; padding:3px; font:12px arial; color:black;"><b>Online Contact Form</b></div>
    <div style="padding:10px; font: normal 12px Arial; text-align:left;">What is your name?<br />
    <input type="text" name="name" size="34" style="width:230px;" /><br />
    Where are you from?<br /><input type="text" name="where" size="34" style="width:230px;" /><br>
    E-mail address?<br /><input type="text" name="replyemail" size="34" style="width:230px;" /></div>
    <div align="center">
    <input type="submit" name="submit" value=" Send ">
    <input type="hidden" name="usernum" size="1" style="border: 0px solid black; height: 0px; width: 0px;" value="587815930" /><input type="hidden" style="border: 0px solid black; height: 0px; width: 0px;" name="MAX_FILE_SIZE" value="2000000"><input type="hidden" style="border: 0px solid black; height: 0px; width: 0px;" name="cpv" value="2" />
    <input type="reset" name="reset" value=" Clear "></div>
    </form>
    <div align="center" style="margin: 5px;"><a title="Free Email Forms from Bravenet" href="http://www.bravenet.com"><img src="http://images.bravenet.com/cp/bn-emailfwd.gif" alt="Free Email Forms from Bravenet" border="0"></a></div>
    </div>
    </div>
    <!-- End Bravenet.com Service Code -->

    Member [Dreamsonthefly] January 31, 2004 12:00:56
    Then how do you explain your e-mails to me, below is a copy of what was submitted and sent to me. I'm sorry I'm not trying to be difficult, but I just don't understand how this has just stopped working.
    Dreams on the Fly
    http://www.dreamsonthefly.com

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There is something wrong on their end and it is not the coding of the form.
    (although I did take a roundabout way to keep Bravenet from displaying
    the hidden form fields as well as the values of the submit and reset buttons)

    Below is their unadultered sample form codes which
    the results are not being timely recieved either.
    Code:
    <!-- DO NOT CHANGE OR REMOVE THE 3 TAGS BELOW THIS COMMENT -->
    <form action="http://pub4.bravenet.com/emailfwd/senddata.php" method="post">
    <input type="hidden" name="usernum" value="290884376" />
    <input type="hidden" name="cpv" value="2" />
    <!-- DO NOT CHANGE OR REMOVE THE 3 TAGS ABOVE THIS COMMENT -->
    <table align="center">
    <tr>
    <td width="50%" align="right">Enter Your Name:</td>
    <td>
    <input type="text" name="change_this" value="" size="20" maxlength="40">
    </td>
    </tr>
    <tr bgcolor="#f6f6f6">
    <td width="50%" align="right" style="border-top: solid 1px #969696;">
    Enter Your Address:
    </td>
    <td style="border-top: solid 1px #969696;">
    <input type="text" name="change_this" value="" size="20" maxlength="40">
    </td>
    </tr>
    <tr>
    <td style="border-top: solid 1px #969696;">
    Your favorite music:<br><br>
    <input type="checkbox" name="rock" value="yes" checked style="border:0px;"> Rock<br>
    <input type="checkbox" name="opera" value="Opera" style="border:0px;"> Opera<br>
    <input type="checkbox" name="country" value="Country" style="border:0px;"> Country<br>
    <input type="checkbox" name="folk" value="Folk" style="border:0px;"> Folk<br>
    <input type="checkbox" name="classical" value="Classical" style="border:0px;"> Classical<br>
    </td>
    <td style="border-top: solid 1px #969696;">Your favorite fruit:<br><br>
    <input type="radio" name="fruit" value="Apples" checked style="border:0px;"> Apples<br>
    <input type="radio" name="fruit" value="Oranges" style="border:0px;"> Oranges<br>
    <input type="radio" name="fruit" value="Lemons" style="border:0px;"> Lemons<br>
    <input type="radio" name="fruit" value="Pears" style="border:0px;"> Pears<br>
    <input type="radio" name="fruit" value="Bananas" style="border:0px;"> Bananas<br>
    </td>
    </tr>
    <tr bgcolor="#f6f6f6">
    <td align="right" style="border-top: solid 1px #969696;">
    Your favorite car:
    </td>
    <td style="border-top: solid 1px #969696;">
    <select name="change_this" size="1">
    <option value="mustang" SELECTED>Mustang</option>
    <option value="civic">Civic</option>
    <option value="cadillac">Cadillac</option>
    <option value="lincoln">Lincoln Continental</option>
    <option value="toyota">Tercel</option>
    <option value="lexus">Lexus</option>
    <option value="taurus">Taurus</option>
    <option value="neon">Neon</option>
    <option value="intrepid">Intrepid</option>
    <option value="beetle">Beetle</option>
    </select>
    </td>
    </tr>
    <tr >
    <td colspan="2" align="center" style="border-top: solid 1px #969696;">
    <textarea cols="40" rows="4" name="change_this">
    </textarea>
    <br><br>
    <input type="submit" name="submit" Value="Submit Form">
    <input type="reset" name="reset" value="Reset Form">
    </td>
    </tr>
    </table>
    </form>
    I forget. Does your host support PHP or CGI so you can install
    your own form handling script? Bravenet stinks! And I got to tell
    ya'. It is a great personal sacrifice to change my security setting
    to allow them to place cookies on my machine so I can test the
    form handling.

    .....Willy

    BTW: No it is not warm here. It has not been above 15 degrees in weeks.
    We have had several feet of snow and they are predicting more falling tonight.

  • #5
    Regular Coder
    Join Date
    Nov 2003
    Location
    Seattle
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP or CGI

    I don't think they do.

    BTW~Although I don't know exactly where you are, I do know that the East is getting is bad. Remember there is a slot open for Steelhead fishing in March. The weather here today is about 33 and cloudy, no rain. But the fish are stacked up like we've never seen before, and we expect the native in March to go wild.

    Okay, on to the business at hand. Since Homey Stud, doesn't seem to want to host CGI or PHP, do you have any wonderful suggestions. And Bravenet...oh don't even get me started there!

    Again I owe you a million thanks!

    Rhonda
    Dreams on the Fly
    http://www.dreamsonthefly.com

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Rhonda;

    If my memory is correct. Aren't you using Homestead to host your site?
    If you are, I was just over at their homepage and it appears that they have form processing/creating as one of their featured tools.

    Create a Form Tool

    Checkbox, Listbox & Textbox Create an online form that allows visitors to check a box, select items from a list, or fill-in their answers with these Form Box tools.

    Dropdown Menu Allow visitors filling out your online form to select from a long list of options that drop down with a click of a button.

    Option Button Use the Option Button on your online form when you want visitors to select only one answer from a selection of two or more.

    Send Data to E-mail Gather feedback or information from visitors with your online form then choose to have the data sent to your e-mail.

    Send Data to File Choose to have the data from your online form sent to a text file in your account which you can easily access when you log in.


    .....Willy

  • #7
    Regular Coder
    Join Date
    Nov 2003
    Location
    Seattle
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ah Willy!

    Thanks for the Homestead ideas. I have used a couple of their drop down elements before and really they don't work well into the pages, especially since the pages are black backgrounds. Anyway, I appreciate your taking a look at their stuff.

    I finally convinced bravenet that this was there problem and viola, it is repaired. It seems that the "check here if you want to be included in our newest ideas" or get an American Flag free boxes, when checked where sending my stuff into cyberspace.

    I just tested everything again, and they have it fixed.

    Again, think about the end of March, Big Beautiful, Bright, Jumpin fast, Steelhead.

    Rhonda
    Dreams on the Fly
    http://www.dreamsonthefly.com

  • #8
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Rhonda;

    It looked to me that Bravenet had made a few changes to their confirmation page. And it seems that they were trying to grab your users email address to use for their bidding. Which was probably why their tech wanted you to change the form setup.

    <input type="text" name="replyemail" size="34" style="width:230px;" />

    I'm glad you got it fixed, but you should look into Homestead's form processing tools. It's one of the perks of your site and you really shouldn't need to use Bravenet.

    The fishing trip sounds good and I could use a vacation. But I will not be able to make any plans until the end of this month. Will that be too late to confirm?

    .....Willy

  • #9
    Regular Coder
    Join Date
    Nov 2003
    Location
    Seattle
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fishing?

    No the end of the month is not too late. Just let me know.

    Rhonda
    Dreams on the Fly
    http://www.dreamsonthefly.com


  •  

    Posting Permissions

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