d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need A Little Help With Forms + Mailto
Add Reply New Topic New Poll
Member
Posts: 4,905
Joined: Feb 19 2012
Gold: 0.00
Jan 27 2013 04:08pm
Just need a quick little hand, not sure why this isn't working right. I'll pay 20fg to whoever answers first.

Here is the HTML section that I'm looking to fix.

Code
<div id="419793887638628172" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"><form enctype="multipart/form-data" action="http://www.weebly.com/weebly/apps/formSubmit.php" method="POST" id="form-22">
<div align="left"><br>
<input type="checkbox" name="option1" value="Square"> Square Cake<br>
</div><br><br><br></div>



</div>

</td>
<td class='wsite-multicol-col' style='width:50%;padding:0 15px'>

<div><div id="866714986710544868" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"><div align="left"><br>
<input type="checkbox" name="option1" value="Round"> Round Cake<br>
</div><br><br><br></div>



</div>

</td>
</tr>
</tbody>
</table>
</div></div></div>

<div><div class="wsite-multicol"><div class='wsite-multicol-table-wrap' style='margin:0 -15px'>
<table class='wsite-multicol-table'>
<tbody class='wsite-multicol-tbody'>
<tr class='wsite-multicol-tr'>
<td class='wsite-multicol-col' style='width:50%;padding:0 15px'>

<div><div id="861327666912500396" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml">Number of guest's <br><input type="text" name="guestcount"><br><br></div>



</div>

<div><div id="814870057921724834" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml">Colors (Split with a comma) <br><input type="text" name="colors"><br><br><br></div>



</div>

</td>
<td class='wsite-multicol-col' style='width:50%;padding:0 15px'>

<div><div id="273113514676845123" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml">Tier's <br><input type="text" name="tiers"><br><br></div>



</div>

<div><div id="152707888520367956" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml">Special Text <br><input type="text" name="text"><br><br><br></div>



</div>

</td>
</tr>
</tbody>
</table>
</div></div></div>

<div><div id="580832483117061041" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"><textarea rows="10" cols="56">
Describe your cake and all of its details in here, how do you envision your cake?
</textarea></div>



</div>

<div><div id="317645439299837684" align="center" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"><div>
 <input type="hidden" name="form_version" value="2" />
 <input type="hidden" name="wsite_approved" id="wsite-approved" value="approved" />
 <input type="hidden" name="ucfid" value="22" />
 <input type='submit' style='position:absolute;top:0;left:-9999px;width:1px;height:1px' /><a class='wsite-button' onclick="document.getElementById('form-22').submit()"><span class='wsite-button-inner'>Submit</span></a>
</div>
</form></div>


In this form, you have multiple checkboxes and everything that is tied into the form id of 22. Now, at the bottom, you have the Submit button which should pull all that data from the form 22 and email it to the specified email address on the website.

Now, using a default form the website has, it emails me properly and everything but it limited to the checkboxes ect. so I wanted to do a custom one. I don't know a lot of HTML so I did what I thought would work but to no avail.

Here is the pre-built form that does email me when the submit button is pressed.

Code

<form enctype="multipart/form-data" action="http://www.weebly.com/weebly/apps/formSubmit.php" method="POST" id="form-878481278311727976">
<div id="878481278311727976-form-parent" class="wsite-form-container" style="margin-top:10px;">
 <ul class="formlist" id="878481278311727976-form-list">
   <h2 style="text-align:center;">For any questions or concerns please submit an email to us and we will reply in kind as soon as possible.</h2>

<div><div class="wsite-form-field" style="margin:5px 0px 5px 0px; width:380px;">
 <label class="wsite-form-label" for="input-116387641345083871">Name <span class="form-required">*</span></label>
 <div style="clear:both;"></div>
 <div class="wsite-form-input-container wsite-form-left">
   <input id="input-116387641345083871" class="wsite-form-input wsite-input" type="text" name="_u116387641345083871[first]" style="width:138px;" />
   <label class="wsite-form-sublabel" for="input-116387641345083871">First</label>
 </div>
 <div class="wsite-form-input-container wsite-form-right">
   <input id="input-116387641345083871-1" class="wsite-form-input wsite-input" type="text" name="_u116387641345083871[last]" style="width:205px;" />
   <label class="wsite-form-sublabel" for="input-116387641345083871-1">Last</label>
 </div>
 <div id="instructions-116387641345083871" class="wsite-form-instructions" style="display:none;"></div>
</div>
<div style="clear:both;"></div>

</div>

<div><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
 <label class="wsite-form-label" for="input-315898484296155368">Email <span class="form-required">*</span></label>
 <div class="wsite-form-input-container">
   <input id="input-315898484296155368" class="wsite-form-input wsite-input" type="text" name="_u315898484296155368" style="width:370px;" />
 </div>
 <div id="instructions-315898484296155368" class="wsite-form-instructions" style="display:none;"></div>
</div></div>

<div><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
 <label class="wsite-form-label" for="input-538318505849850773">Comment <span class="form-required">*</span></label>
 <div class="wsite-form-input-container">
   <textarea id="input-538318505849850773" class="wsite-form-input wsite-input" name="_u538318505849850773" style="width:370px; height: 200px"></textarea>
 </div>
 <div id="instructions-538318505849850773" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
 </ul>
</div>
<div style="display:none; visibility:hidden;">
 <input type="text" name="wsite_subject" />
</div>
<div style="text-align:left; margin-top:10px; margin-bottom:10px;">
 <input type="hidden" name="form_version" value="2" />
 <input type="hidden" name="wsite_approved" id="wsite-approved" value="approved" />
 <input type="hidden" name="ucfid" value="878481278311727976" />
 <input type='submit' style='position:absolute;top:0;left:-9999px;width:1px;height:1px' /><a class='wsite-button' onclick="document.getElementById('form-878481278311727976').submit()"><span class='wsite-button-inner'>Submit</span></a>
</div>
</form>


So what I'm trying to accomplish is a form that has all of the check boxes from the first source that when pressing the submit button will email a designated email. If this can be done without all of the web hosts custom HTML pages ect. used in the code, that would be fine by me. I just don't want the person to hit the submit button and the default windows email program opens. I want the website to directly email me.

Thanks.

This post was edited by Damein on Jan 27 2013 04:13pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Jan 27 2013 04:20pm
so the change you want is to send an email automatically instead of opening outlook?

unless i'm mistaken, i think you forgot to post the only code that matters: the php page that executes when you submit the form.
Code

http://www.weebly.com/weebly/apps/formSubmit.php


the html doesn't send email; it takes server side code to do that.

http://php.net/manual/en/function.mail.php

This post was edited by carteblanche on Jan 27 2013 04:31pm
Member
Posts: 4,905
Joined: Feb 19 2012
Gold: 0.00
Jan 27 2013 06:04pm
I see, I've never messed with PHP execution. So I'm not 100% sure on what you mean. Do I need the data from that .php file to be able to accomplish this?
Member
Posts: 4,905
Joined: Feb 19 2012
Gold: 0.00
Jan 27 2013 06:55pm
Can't edit, but yes, you're right. I don't want Outlook to open, I just want the email to be sent.
Member
Posts: 9,412
Joined: Nov 18 2009
Gold: 20.00
Jan 27 2013 07:03pm
The problem is that the input names are different on each one

the input names have to be the same


Post the php file and I will fix it for you there, or you could just change the names so that they are the same as the names in the second quote.
Member
Posts: 9,412
Joined: Nov 18 2009
Gold: 20.00
Jan 27 2013 07:06pm
Actually you have many problems, not just the names.

The checkboxes are treated differently, and each checkbox needs a different name to work with the php properly.

For example, both the first and second checkbox cannot be named option1.

/edit But more importantly, there are more inputs then the other quote has, therefore you are going to have to make changes to your php.

I could show you what to change if you posted the php file.



This post was edited by PixileDust on Jan 27 2013 07:15pm
Member
Posts: 4,905
Joined: Feb 19 2012
Gold: 0.00
Jan 27 2013 07:53pm
Well, the webhost is just a random freebie, I don't think they give me access to the PHP files. So is there a way to do it that won't require me to do so?
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll