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 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript button action

    Hi Guys,

    I new here and a total novice html css easy java is a no no im trying to learn but its tough.

    Well the reason im posting is this, Im a supervisor for a technical support team and I want to build a trouble shooter for them. Basically im going to build a website which is basically button click guided depending on a answer.

    E.g has the customer done this yes or no and when they click the relevant option javascript write the action to a text box and at the end of the trouble shooting they can copy and paste the information into there notes containing the relevant trouble shooting information.

    This possible?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,624
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    Quote Originally Posted by robxln View Post
    This possible?
    Yes.


  • #3
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    with me being a novice would it be an exrteme nightmare to code?

  • #4
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just to state im doing this off my own back just for my agents as a bit of help i wish i was getting paid for it but im on national minimum in a call center tech support supervisor

  • #5
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,915
    Thanks
    56
    Thanked 545 Times in 542 Posts
    Quote Originally Posted by robxln View Post
    with me being a novice would it be an exrteme nightmare to code?
    no... maybe... hard to say given the information supplied.

    If you know html already, you should make the page how you want it (with the buttons and the text area, etc) and then post the markup here with a description of what you want the buttons to do. I'm sure someone will be along to help you out.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    Does this help?
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
      <head>
    
        <title>Trouble Shooting</title>
    
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Script-Type" content="text/javascript" />
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <meta http-equiv="Content-Language" content="en-US" />
        <meta name="Author" content="James Alarie - jalarie@umich.edu" />
        <meta name="description" content="Questions lead to trouble-shooting actions." />
        <meta name="keywords" content="trouble,shooting,question,action" />
        
        <link rel="icon" href="favicon.ico" />
        <link rev="made" href="mailto:jalarie@umich.edu" />
        
    <!--
        Author:    James Alarie
        Company:   -independent-
        Address:   3391 N Genesee Rd
                   Flint  MI  48506
                   Latitude: 42.9663  Longitude: -83.7769
        Telephone: +1-810-736-8259
        Fax:       -none-
        Web Site:  http://spruce.flint.umich.edu/~jalarie/
        E-Mail:    jalarie@umich.edu
        Comments:  Having said that, I've probably told you more than I know.
    -->
    
        <link rel="stylesheet" type="text/css" href="style1.css" />
        <style type="text/css">
          /*<![CDATA[*/
          /*]]>*/
        </style>
        
        <script type="text/javascript" src="style1.js"></script>
        <script type="text/javascript">
          /*<![CDATA[*/
    
      Questions=new Array(                              // question~action
        'Is it unplugged~plug it in',
        'Is the power switch turned off~turn it on',
        ''
      );
      function ClickIt(What) {
        document.forms[0].Text.value=document.forms[0].Text.value+'\n'+What;
        return true;
      } // ClickIt
    
          /*]]>*/
        </script>
    
      </head>
    
      <body class="body1">
       <div id="body">
    <!-- Page Header -->
        <div id="header">
          <h1>Trouble Shooting</h1>
          <hr />
        </div>
    
    <!-- Content -->
        <div id="content">
          <br />
          <noscript>
            <p class="notice">
              You must have scripting enabled to make full use of this page.
            </p>
          </noscript>
          
          <div class="center">
            <form method="post" action="javascript:void(0);" style="text-align: left;">
             <div class="form">
              <script type="text/javascript">
                /*<![CDATA[*/
    
      for (ix1=0; ix1< Questions.length-1; ix1++) {
        SingleItem=Questions[ix1];
        Parts=SingleItem.split('~');
        Out ='';
        Out+='<input type="checkbox" name="CB'+ix1+'" id="CB'+ix1+'" value="'+Parts[1]+'" onclick="ClickIt(this.value);" \/>\n';
        Out+=Parts[0];
        Out+='<br \/>';
        document.write(Out);
      }
    
                /*]]>*/
              </script>
              
              <br />
              <textarea cols="70" rows="3" name="Text" id="Text" onfocus="this.select();"></textarea>
             </div><!-- form -->
            </form>
            
          </div><!-- center -->
      
        </div>
      
    <!-- Page Footer -->
        <div id="footer">
          <br clear="all" /><hr />
          Written on Februry 14, 2014, by:&nbsp;
          <a href="mailto:jalarie@umich.edu">James Alarie</a>.
        </div>
    
       </div>
      </body>
    
    </html>

  • #7
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,300
    Thanks
    28
    Thanked 275 Times in 269 Posts
    Quote Originally Posted by jalarie View Post
    Does this help?
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <!-- [...] -->
    
        document.write(Out);
    You do realize that document.write is incompatible with XML, right? I find it a bit amusing that you jumped through all of the XML hoops then wrote that into your script ensuring that it won't work in an XML environment.

    Also, the behavior is a bit strange when the page is displayed as HTML (where the script is fully functional); checking and unchecking the checkboxes has the same effect: it adds text to the text box. It'd make more sense to use buttons instead of checkboxes.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    Quote Originally Posted by Arbitrator View Post
    You do realize that document.write is incompatible with XML, right? I find it a bit amusing that you jumped through all of the XML hoops then wrote that into your script ensuring that it won't work in an XML environment.

    Also, the behavior is a bit strange when the page is displayed as HTML (where the script is fully functional); checking and unchecking the checkboxes has the same effect: it adds text to the text box. It'd make more sense to use buttons instead of checkboxes.
    I have a base file (in xhtml) that I use for quick replies; I added just enough to give an example of a place to start. What I posted was not intended as a proper, fully built, tested in all browsers answer. It needs a lot of work and can easily be converted to simple html if that is what is desired.


  •  

    Posting Permissions

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