Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-02-2012, 10:50 PM   PM User | #16
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 08-02-2012, 11:18 PM   PM User | #17
Sabu
New to the CF scene

 
Join Date: Aug 2012
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Sabu is an unknown quantity at this point
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?
Sabu is offline   Reply With Quote
Old 08-03-2012, 03:40 AM   PM User | #18
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 08-03-2012, 03:59 AM   PM User | #19
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,764
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
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.
Quote:
Multi-Value Drop-Down List
Apr 4, 2007
I've (hopefully) learned a lot since then.
jmrker is offline   Reply With Quote
Old 08-03-2012, 04:45 AM   PM User | #20
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 08-03-2012, 02:56 PM   PM User | #21
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,764
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
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!
jmrker is offline   Reply With Quote
Old 02-11-2013, 01:00 AM   PM User | #22
Sabu
New to the CF scene

 
Join Date: Aug 2012
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Sabu is an unknown quantity at this point
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>
Sabu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:55 AM.


Advertisement
Log in to turn off these ads.