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.
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,525
    Thanks
    80
    Thanked 4,490 Times in 4,454 Posts
    Well, I would assume that will be done with server-side code: PHP/JSP/ASP...whatever you are using. After they make all their choices and submit the <form> to your server-side code. It shouldn't have anything to do with JavaScript.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  2. #17
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a problem.

    I'm trying to implement "send e-mail" but in the e-mail body it appears:

    First=&locations=dishwasher&addToCart=dishwasher

    The code is like this:
    <form id="theForm" method="post" action="mailto:contact@pirena.ro" >
    E-mail client<input type="text" name="First" size="12" maxlength="12">

    <input type="submit" value="Send Email" />

    Is there a code to convert the html in pdf, jpg or something?

  3. #18
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,525
    Thanks
    80
    Thanked 4,490 Times in 4,454 Posts
    You should *NOT* be using <form action="mailto:...">

    Only about 60% or so of people will be able to use your site when you do that.

    You *NEED* a form mailer that is written in SERVER-SIDE code.

    And the general answer to your question is "No." MAILTO: is a horrible way to send mail, not only for the reason I gave above but also because of the lack of control.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  4. #19
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Lightbulb

    Quote Originally Posted by Old Pedant View Post
    That works, but it is clumsy code, depending on the option number to choose which to display. And then, on top of that, needing a separate IF for each option. Ugh.
    Yeah, but look when it was originally written.
    Multi-Value Drop-Down List
    Apr 4, 2007
    I've (hopefully) learned a lot since then.

  5. #20
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,525
    Thanks
    80
    Thanked 4,490 Times in 4,454 Posts
    Oops...didn't know you wrote it. **BLUSH** I guess I need to be more circumspect in my opinions. I'll buy you a latte to help make up. You can collect next time you are in Seattle area.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  6. #21
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Arrow

    Quote Originally Posted by Old Pedant View Post
    Oops...didn't know you wrote it. **BLUSH** I guess I need to be more circumspect in my opinions. I'll buy you a latte to help make up. You can collect next time you are in Seattle area.
    Not a problem. Since you have 10X the number of posts and 10X the number of thanks, I believe you can be forgiven for my lack of experience at the time. In fact, I'm not sure I am that much better now as I have learned over time that I am never too old to learn a new way of being stupid!

  7. #22
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    guys, please help me because i didn't find any solution for this problem.
    I cannot make the 2 option fields work togheter, only 1 option field is working. Then other one is not showing the divs. If you try this code you will see the the option field from the right is working. Probably is something caused by the javascript. I've tried the body onload option but it's not working. Can you help me? Thank you!

    Here is the code:
    <html>
    <head>
    <title> New Document </title>

    <body onload="dothat();">

    <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
    <script type="text/javascript">
    function dothat() {
    var div_id = $("#choice").val();
    if (div_id == 0) {
    $("#div1").hide();
    $("#div2").hide();
    $("#div3").hide();
    };
    if (div_id == 1) {
    $("#div1").show();
    $("#div2").hide();
    $("#div3").hide();
    };
    if (div_id ==2) {
    $("#div1").show();
    $("#div2").show();
    $("#div3").hide();
    };
    if (div_id == 3) {
    $("#div1").show();
    $("#div2").show();
    $("#div3").show();
    };
    }
    </script>


    <style type="text/css">
    #div1, #div2, #div3 {
    display:none;}
    </style>




    <select id="choice" onchange="dothat();">
    <option value="0">Make a selection</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </body>

    <body onload="dothis();">

    <script type="text/javascript">
    function dothis() {
    var div_id = $("#choice2").val();
    if (div_id == 0) {
    $("#div11").hide();
    $("#div22").hide();
    $("#div33").hide();
    };
    if (div_id == 1) {
    $("#div11").show();
    $("#div22").hide();
    $("#div33").hide();
    };
    if (div_id ==2) {
    $("#div11").show();
    $("#div22").show();
    $("#div33").hide();
    };
    if (div_id == 3) {
    $("#div11").show();
    $("#div22").show();
    $("#div33").show();
    };
    }
    </script>


    <style type="text/css">
    #div11, #div22, #div33 {
    display:none;}
    </style>

    <select id="choice2" onchange="dothis();">
    <option value="0">Make a selection</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>

    <div id='div11'>div11
    <br><input type="checkbox" name="service" value="titrare" /> A fost reglata concentratia de aditiv de clatire
    <br><input type="checkbox" name="service" value="titrare" /> Au fost verificate bratele de spalare/clatire</div>

    <div id='div22'>div22
    <br><input type="checkbox" name="service" value="titrare" /> Masina de spalat este plina de calcar
    <br><input type="checkbox" name="service" value="titrare" /> Masina de spalat este foarte murdara</div>

    <div id='div33'>div33
    <br><input type="checkbox" name="service" value="titrare" /> Masina de spalat nu functioneaza corespunzator
    <br><input type="checkbox" name="service" value="titrare" /> Masina de spalat nu functiona la momentul vizitei</div>


    </body>

    </head>
    </html>


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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