Copy link to clipboard
Copied
Hello,
I am working with Dreamweaver CS4 - Version 10 - still - and realize it is out of date. I manage a few websites, and have used Contact form scripts on all the sites which have worked successfully. The sites are hosted through different companies though. On one of the sites though, I am having an issue with the Contact form no longer working, and it appears to be a Dreamweaver contact form script that is the problem. The form no longer Submits or Resets, so there is either something wrong with the script which could be outdated, or it is somehow incompatible with the hosting service's server - but I don't really know. We are using Bluehost.com for hosting, and they don't give technical support for code on websites - they only host - so it is hard to know for sure why my Contact form is no longer working. I have verified that it isn't the email address - which is correctly coded into the submit button script. I am not sure if it is due to the age of my Dreamweaver program, and the script it generated for the form, so that is why I am posting here. Below I have copied and pasted the code so someone might take a look and let me know what they think. Dreamweaver inserted an 'onclick="MM_validateForm' script into the Submit button. This worked before, but maybe it no longer works - but I don't know. Below I have shown all the coding on the page, for the form, starting with the head section javascript.
In my <head> section of the website page, I have this javascript inserted, to make the form work:
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
//-->
</script>
And here is the form script I am using in the <body> section of the page, shown below. The problem seems to occur with the Submit button, which doesn't initiate any action when the form is clicked and nothing happens when either the Submit or the Rest buttons are clicked.
Here is the specific code for both the Submit and the Reset buttons, contained within the overall form code below:
Submit button:
<input name="Submit2" type="submit" onclick="MM_validateForm('firstname','','R','lastname','','R','email','','RisEmail','TextArea','','R');return document.MM_returnValue" value="Submit" class="formbutton" />
Reset button:
<input type="reset" value="Reset" name="Reset2" class="formbutton"/>
The complete form code:
<form name="contactform" action="http://www.bluehost.com/bluemail" enctype="multipart/form-data" method="POST">
<blockquote>
<p align="left"><b>
<span class="formtitle"><br />
* First Name:</span></b>
<label>
<input name="firstname" type="text" class="textbox" id="firstname" size="30" maxlength="30" />
</label>
</p>
<p align="left">
<label><span class="formtitle">* Last Name:</span>
<input name="lastname" type="text" class="textbox" id="lastname" size="30" maxlength="30" />
</label>
</p>
<p align="left">
<label><span class="formtitle">Phone:</span>
<input name="phone" type="text" class="textbox" id="phone" size="15" maxlength="15" />
</label>
<label><span class="formtitle">ext.</span>
<input name="extension" type="text" class="textbox" id="extension" size="6" maxlength="6" />
</label>
<br />
<br />
<b><font color="#6699ff"
size="2"
face="Verdana, Arial, Helvetica, sans-serif" class="formtitle">* Email:</font></b>
<label>
<input name="email" type="text" class="textbox" size="25" maxlength="25" id="email" onblur="MM_validateForm('email','','RisEmail');return document.MM_returnValue" />
</label>
</p>
<p align="left"> </p>
<label name="checkbox">
</label>
<p align="left"><br />
<b><font color="#6699ff" size="2" face="Verdana, Arial, Helvetica, sans-serif" class="formtitle">Questions/Comments:</font></b><br />
<br />
<textarea name="TextArea" cols="40" rows="8" wrap="virtual" class="textbox" id="TextArea"></textarea>
</p>
<p align="left">
<input type="hidden" name="sendtoemail" value="me@myemail.com" /> [removed personal email address - Mod]
<input type="hidden" name="redirect" value="http://www.cjvolk.com/thankyou.html" />
<input name="Submit2" type="submit" onclick="MM_validateForm('firstname','','R','lastname','','R','email','','RisEmail','TextArea','','R');return document.MM_returnValue" value="Submit" class="formbutton" />
<input type="reset" value="Reset" name="Reset2" class="formbutton"/>
</p>
<p> </p>
</blockquote>
</form>
If someone can please tell me - is this a Dreamweaver code problem, where the code is out of date for the browsers now, or could it be some other issue? Does anyone have a suggestion, since I am using an older version of Dreamweaver as to the best way to update this code?
I appreciate anyone's input or answers - hope to get some help soon! Thank you very much!
Jackie
The form submit and reset buttons are working.
All you need do to test this is create a new DW document and insert the form code plus the <script></script> code.
There must be something else on your page stopping the form buttons working. Can you link to the actual page in question then maybe someone can take a more indepth look at what that could be.
EDITED: Submit and reset buttons are work on your contact page:
CJVolk Associates - Treasury and Cash Management Consulting Services
Edited: Ok maybe
...Copy link to clipboard
Copied
Here is a good page on the @W3Schools website, about how to use the various attributes:
It says:
The pattern attribute specifies a regular expression that the <input> element's value is checked against.
The pattern attribute works with the following input types: text, search, url, tel, email, and password.
Tip: Use the global title attribute to describe the pattern to help the user.
Tip: Learn more about regular expressions in our JavaScript tutorial.
An input field that can contain only three letters (no numbers or special characters):
Country code: <input type="text" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code">
Too bad they don't give an example for telephone numbers!
Copy link to clipboard
Copied
I was in online chat with Bluehost tech support a little while ago. They have quit supporting that wonderful snippet of code that worked so well.
I simply wrapped it around the email form I set up about 2 years ago after fighting with my form to get it talk to Bluehost.
It really is a shame the snippet has been disabled by Bluehost and Bluemail. It really was a fantastic little bit of code.
Copy link to clipboard
Copied
What does Bluehost recommend you use now?
Does your server support PHP and the PHP mail() function?
Copy link to clipboard
Copied
Actually, I checked the Bluemail website where they provided directions for continuing to use their script at Bluehost. The solution is found by clicking on the </> Script (CGI) button in C-Panel after signing into your Bluehost C-Panel.
Once that opens, Bluemail is still there and functioning. I selected "generate code" and it still generates the wonderful script it did before that wraps around your selected Dreamweaver options for the form. I did notice some updates to it that take advantage of coding improvements of the last few years.
Bluehost recommended checking into services that generate contact forms, but those were all for CRM (Contact Relationship Management) and didn't serve my purpose.
I have to finish customizing the script, but I'm quite happy Bluemail is still supporting activities with Bluehost. Next idea - adapt the script for use with the other hosting service I deal with, Gridhoster. Unfortunately, Gridhoster doesn't have the handy code generator for contact forms. Keeping my fingers crossed that it works as smoothly as it used to and can be adapted to Gridhoster's mail system.
I also stumbled on a Bootstrap site, http://bootstrapious.com. They offer templates and user guidance. One was a contact form and one was a blog layout I really liked. So, I downloaded some of their templates and a "cheat sheet" of sorts. I still have to open the zip files but within 24 hours of signing up for their newsletter and downloading a collection of their templates, I heard from the site owner to inquire as to whether the template was what I was looking for and whether I needed any assistance customizing the templates to my needs.
Copy link to clipboard
Copied
Just reading this second message now. That is good to know that they still offer some support for the code generated by Dreamweaver for the form script.
I need to take a look at this, plus the Bootstrap site, also. Again, I need to find the time to tackle this when I am able to think it all through. Sounds like you are really on top of these form scripts. I will let you know when I get a chance to take a look first at the Bluehost CGI. I hope I can figure this out. I wish I could just hire someone like you to do it for me!
Copy link to clipboard
Copied
Hi Nancy,
I am sorry that I did not get your messages until now. Bluehost does not give any recommendations. They do support PHP and the mail function, but they don't give any type of tech support, so I was not able to get help from them.
I tried to get help from the developer of the script that I downloaded, and actually gave monetary contributions to him, but he only answered one question briefly, then I did not hear from him again. It has been a couple of months since I tried to tackle this as I got swept up in other projects and literally had to put this one aside, so I need to get back to it when I can. I have not had a chance to solve it yet, however and I'm not sure when I will.
I felt like the developer should have been more helpful. As it stands, here is the website page where the form appears. It works but I was not able to customize the form to look the way I wanted it to, even though it says in the form that you can do that. I wanted to add additional fields, but the process of setting it all up was confusing - at least to me - since I'm not a developer. It came with a dashboard and I tried to follow the instructions, but there were some tricky things about how you had to work with it which if you did not know at each step how to handle, you were not able to do what you wanted to to create the type of form fields and information you wanted. Anyway... here is a link to the page - if you wanted to see it:Contact CJ Volk
Thank you for your help. Not expecting you to solve this for me... I just need to find the time to tackle it again when it is not so overwhelming.
Copy link to clipboard
Copied
If you want to do it yourself, I put together a 3 part tutorial.
Alt-Web Design & Publishing: Responsive Contact Form with Bootstrap 3.2 and PHP (Part 1)
Copy link to clipboard
Copied
I realize this is pretty old, but when I dealt with this issue, the only problem was that the form action URL http://www.bluehost.com/bluemail needed to be changed to https at the beginning. (I didn't get an email from them when they changed that...)
The only reason I'm posting about this now is that address gives a 404 error. This page comes up when looking for BlueHost mail script-related answers. I'll update this whenever I get new information.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more