37 users online (0 members and 37 guests)  


Page 1 of 2 1 2 Last
  Results 1 to 15 of 16

Related

  1. HTML Form Question    Forum: HTML Forum
    Replies: 7
  2. Form Question    Forum: HTML Forum
    Replies: 4
  3. text form question    Forum: Website Scripts Forum
    Replies: 0
  4. Form Question    Forum: Website Scripts Forum
    Replies: 2
  5. Form Question    Forum: CGI Perl Forum
    Replies: 5
  1. #1
    Justin27's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Location
    Kansas City, Missouri
    Posts
    13

    Another form question?....

    I hav an other form that I am working on for my company. My question is: You put in a submit button into the form to e-mail the data. Except when You hit the submit how do you get ti to automatically clear the form. Becuase, this form is going to be reused over and over. Right now when you hit the submit button it e-mails the data but you have to hit a seperate reset button to clear the form. I have the reset for mistakes. I need a way that it can automatically reset after the e-mail. If anyone can help me that is great and I would be very thankful again or even a point in some direction that I can get the information. This is the code I'm using for the buttons. <input type="submit" value="E-Mail"><input type="reset">.

  2. #2
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    Recommendation:

    Do not automatically clear the FORM!

    If there's one email after another being sent, then it appears likely the contents of each are going to be similar. Users might not want to have to retype all the data in each submission each and every time.

  3. #3
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Here is a simple form, with the necessary code for what you want. This will only work with Internet Explorer, no decent browser will let a script continue after submit() -

    Code:
    <form method="post" action="mailto:dean@somepeople.net" name="autoform">
    <input type="text" name="Stoat">
    <br />
    <input type="button" onClick="autoform.submit();autoform.reset()";" value="Go">
    </form>
    Pay attention to the form name= tag, and the path used in the JavaScript.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  4. #4
    Justin27's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Location
    Kansas City, Missouri
    Posts
    13
    I should have put the script out there for you guys to look at I'm sorry. What the form does is it is a way to automate how our helpdesk manager send us our phone scripts. We are in a ACD and we have 5 queue that we log into using a script that is determined and sent to use by our supervisor. Then we key them into our phones. What I am doing is setting up a table form where it has our queue's and our names and extensions. What I have setup are drop down boxs under each queue for him to pick the priority for that queue. There is a button on the end that e-mails the associate the queue priorities. in this format:
    2706 == 1
    and so on. What it is not doing is when I hit e-mail at the end of a row it is leaving the selected priorities there rather than resetting them to nothing. here is a copy of the code for one section:
    <h1><center><font face="arial black"color="#2B60DE">Gentiva</font> </center></h1>
    <table border="1" width="994" height="1">
    <tr>
    <td width="265" height="1"><font face="arial black" color="#2B60DE" size="-1">Agent - ID and Extension: </font></td>
    <td width="242" height="1"><font face="arial black" color="#2B60DE" size="-1">Password Reset - 2706: </font></td>
    <td width="206" height="1"><font face="arial black" color="#2B60DE" size="-1">Home Health - 2707: </font></td>
    <td width="156" height="1"><font face="arial black" color="#2B60DE" size="-1">Accredo - 2709: </font></td>
    <td width="194" height="1"><font face="arial black" color="#2B60DE" size="-1">Windows XP - 3106: </font></td>
    <td width="159" height="1"><font face="arial black" color="#2B60DE" size="-1">Overflow - 2713: </font></td>
    <td width="70" height="1"><font face="arial black" color="#2B60DE" size="-1">Action: </font></td>
    </tr>
    <tr>
    <form method="post" action="mailto:jessica.lowery@gentiva.com" enctype="text/plain"> <td width="265" height="1"><font face="arial black" color="#2B60DE" size="+1">Jessie - 2750</font></td>
    <td width="242" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="2706 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="206" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="2707 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="156" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="2709 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="194" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="3106 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="159" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="2713 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="70" height="1"><center><td width="70" height="1"><center><input type="submit" value="E-Mail"></center><center><input type="reset"></center></form></td>
    </tr>
    If there is any way that yo can further help me I would be very greatful. If I tries your Java script QuitetDean do I need to referrence the language in any way like if I had put in a VB script.

  5. #5
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    No references, the onlt thing you need to make sure is that you give the form a 'name' and you use that name in the onclick tag.

    I got this working in IE fine -

    Code:
    <h1><center><font face="arial black"color="#2B60DE">Gentiva</font> </center></h1>
    <table border="1" width="994" height="1">
    <tr>
    <td width="265" height="1"><font face="arial black" color="#2B60DE" size="-1">Agent - ID and Extension: </font></td>
    <td width="242" height="1"><font face="arial black" color="#2B60DE" size="-1">Password Reset - 2706: </font></td>
    <td width="206" height="1"><font face="arial black" color="#2B60DE" size="-1">Home Health - 2707: </font></td>
    <td width="156" height="1"><font face="arial black" color="#2B60DE" size="-1">Accredo - 2709: </font></td>
    <td width="194" height="1"><font face="arial black" color="#2B60DE" size="-1">Windows XP - 3106: </font></td>
    <td width="159" height="1"><font face="arial black" color="#2B60DE" size="-1">Overflow - 2713: </font></td>
    <td width="70" height="1"><font face="arial black" color="#2B60DE" size="-1">Action: </font></td>
    </tr>
    <tr>
    <form method="post" action="mailto:jessica.lowery@gentiva.com" enctype="text/plain" name="priority"> <td width="265" height="1"><font face="arial black" color="#2B60DE" size="+1">Jessie - 2750</font></td>
    <td width="242" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="2706 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="206" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="2707 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="156" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="2709 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="194" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="3106 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="159" height="1"><font face="arial black" color="#2B60DE" size="-1"><center><select name="2713 ="><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT>
    <td width="70" height="1"><center><td width="70" height="1"><center><input type="submit" value="E-Mail" onclick="priority.submit();priority.reset()"></center><center><input type="reset"></center></form></td>
    </tr>
    See if that works.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  6. #6
    Justin27's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Location
    Kansas City, Missouri
    Posts
    13
    I will give it a try thanks a lot.

  7. #7
    Justin27's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Location
    Kansas City, Missouri
    Posts
    13
    One more quick question those lines can I reuse them in the code. Like in my example I have Jessie but I have 9 others that are setup the same way on the table. Is the code reuseable betweenthem?

  8. #8
    Justin27's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Location
    Kansas City, Missouri
    Posts
    13
    I tested it and it works the form is e-mailed and it resets just the person receives the e-mail with the priorities and then they get a second one showing the form has been reset. It si working Just need to kill the second send.

  9. #9
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Oops: Change <input type="submit" to <input type="button" and it will only send once, my fault , sorry.

    You can reuse the each set fine, but you have to change name="priority" and priority.submit();priority.reset() for each one to have a unique name. eg

    name="priority2"
    priority2.submit();priority2.reset()

    Otherwise, it may well send ALL the emails when you clik one button , lol. You'd be popular...
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  10. #10
    Justin27's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Location
    Kansas City, Missouri
    Posts
    13
    That works great thanks a lot do you know a good tutorial site for Java Scripting that I can go to. I like programming and if I can learn the syntax then I probably wouldn't have any problems witht he language. Once again thank you very much.

  11. #11
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    I have found the best JS tutorial to be

    http://www.w3schools.com/js/default.asp

    If your a programmer, you will have no problem with JS.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  12. #12
    Justin27's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Location
    Kansas City, Missouri
    Posts
    13
    Thanks for the link and thanks again.

  13. #13
    Justin27's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2002
    Location
    Kansas City, Missouri
    Posts
    13
    When the form e-mails it gives the results like this:
    2706=1
    Is there a way to get it to drop the (=) in the e-mail message?
    Example code:
    <tr>
    <form method="post" action="mailto:jessica.lowery@gentiva.com" enctype="text/plain" name="priority">
    <td width="265" height="1"><font face="arial black" color="#2B60DE" size="+1">Jessie - 2750</font></td>
    <td width="242" height="1"><font size="-1"><center><select name="2706"><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT></td>
    <td width="206" height="1"><font size="-1"><center><select name="2707"><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT></td>
    <td width="156" height="1"><font size="-1"><center><select name="2709"><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT></td>
    <td width="194" height="1"><font size="-1"><center><select name="3106"><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT></td>
    <td width="159" height="1"><font size="-1"><center><select name="2713"><option selected>Priority<option>1<option>2<option>3<option>4<option>9</SELECT></td>
    <td width="70" height="1"><center><input type="button" value="E-Mail" onclick="priority.submit();priority.reset()"></center><center><input type="reset"></center></form></td>
    </tr>

  14. #14
    afaeriesluv's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    USA
    Posts
    2

    reply-same problem

    Quote Originally Posted by QuietDean
    Here is a simple form, with the necessary code for what you want. This will only work with Internet Explorer, no decent browser will let a script continue after submit() -

    Code:
    <form method="post" action="mailto:dean@somepeople.net" name="autoform">
    <input type="text" name="Stoat">
    <br />
    <input type="button" onClick="autoform.submit();autoform.reset()";" value="Go">
    </form>
    Pay attention to the form name= tag, and the path used in the JavaScript.
    Hi, thankyou for this code, I was having the same problem and this did help me though, is there a way to redirect with this code once the button has been pressed? Thanks!

  15. #15
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    lol your the one I got the odd email off, huh?

    You could try -

    Code:
    onClick="autoform.submit();autoform.reset();location.href=http://wherever.com;"
    I dont know whether this would work tho.

    To be honest, its by FAR better to use a server-side processing like php, asp or Perl. Or your hosts built-in sendmail facility.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Page 1 of 2 1 2 Last

Tags for this Thread