Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Need help with outdated Contact Form Script

Explorer ,
May 05, 2017 May 05, 2017

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

22.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 05, 2017 May 05, 2017

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

...
Translate
LEGEND ,
May 05, 2017 May 05, 2017

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 they are not - seem to be a bit hit and miss

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 05, 2017 May 05, 2017

Thanks Osgood.  I think there is an issue with the Submit and Reset buttons, but don't know what.

However, looks like Nancy answered and may have found more issues with the code itself, so I probably need to just scrap this old code and do a big update.

Thank you very much for taking a look at it.  I will keep everyone posted on the progress.  I have to go out this evening, so won't be able to check back in until maybe tomorrow.  But in the meantime, really appreciate your help!

Jacie

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2017 May 05, 2017

I can't sugar coat this.  The code is awful.  And if that's not bad enough, it commits the evilest of sins by not concealing the email address from robots and spammers.    There's nothing here I would salvage.

Use a plain vanilla HTML5 form with self-validating fields.  Find out from Bluehost which server-side scripts you can use with this hosting plan.  Hopefully the plan supports PHP scripts.

Below is a plain HTML5 form.

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>HTML5 Form</title>

</head>

<body>

<form method="post" action="FORM_PROCESSING_SCRIPT_GOES_HERE.php">

<div>

<h4>Text Field</h4>

<label for="name">Name: <span class="required">*</span> </label>

<input type="text" id="name" name="name" value="" placeholder="First & Last" required="required" autofocus />

</div>

<div>

<h4>Email Field</h4>

<label for="email">Email Address: <span class="required">*</span> </label>

<input type="email" id="email" name="email" placeholder="yourname@email.com" required/>

</div>

<div>

<h4>Text Area</h4>

<label for="message">Message: <span class="required">*</span> </label>

<textarea id="message" name="message" placeholder=" your message here." required></textarea>

</div>

<div>

<input type="submit" value="Submit" id="submit"/>

</div>

</form>

</body>

</html>

At a minimum, your server-side script must conceal the email address, sanitize data, thwart spambots and send data to your email.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 05, 2017 May 05, 2017

Thank you so much, Nancy.  I have been responding to Osgood, but really appreciate your input.  I am going to get rid of this old code and update to an HTML5 form code. Thank you so much for your suggestion, and for the suggestion of using the PHP. 

As I just mentioned to Osgood, this is an older website and I had not updated it in a long time.  So it shows!  You are absolutely right about the email being visible - not good!  I am aware of the issue, but I don't know PHP, so probably didn't know how to implement a better solution at the time I built this website.

Thank you so much - I really appreciate your help, and I will keep both of you posted on the progress when I can get the form code and script updated.  You are very nice to reach out and answer my question!

I have to go somewhere so will have to check back in later.  In the meantime, thanks again and I will let you both know how things work out!  : )))

In appreciation,
Jackie

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 05, 2017 May 05, 2017

On further investigation of the code you are missing a closing " (see in red below AFTER #428284; )

<td width="448" height="483" bgcolor="#CEDDFD" style="border: 1px solid #428284;"><form name="contactform" action="http://www.bluehost.com/bluemail" enctype="multipart/form-data" method="POST">

That should solve the problem.

BUT as Nancy has pointed out this is a cheap and cheerful script which leaves the email address wide open to spam harvestors. Its up to you - if its been serving you well and you have  had little problems then no need to change but if spam has been an issue in the past then consider using a more secure script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 05, 2017 May 05, 2017

Hi again, Osgood,

I did notice that missing " and had inserted that.  I can see it on my end, but maybe I forgot to upload the corrected version.  I will do that now.  Thank you again.

Jackie

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 05, 2017 May 05, 2017

Thanks again.  I just made that fix, and now the submit button works, but I got this message from the server:

me@mysemail.com does not appear to be a valid email address on this server (you cannot send to an external email address).

Could not get email address, or email address not valid. mailto{addr}

  So what I am going to do is try to do what Nancy has suggested, and update to an HTML5 code, and use PHP script on the server side, if I can get the hosting company to install that.  You are both right - the email should not be visible!  Sorry this is an older website and things have really changed, but appreciate both of your help.

I will check back in later and let you know how things go.

thanks again,

Jackie

[Mod note: your personal email address has been removed due to the likelihood that it can be misused by unscrupulous harvesters}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 05, 2017 May 05, 2017

Hi again, Osgood,

Just got your other reply  - although it doesn't show up here in the discussion yet.  I clicked "Assumed Answered" on this post - probably did that too soon.

  Trying to understand what you mean by this  - that I don't want to use the email code format for the email?

Not sure I totally understand this - will have to check back in later though, as I am really rushing now to get somewhere but do want to understand this:

Your message to me/Osgood:

"You probably dont want to do use an email address as the palceholder text:

placeholder="yourname@email.com"

Rather:

placeholder="Your email adddress"

Jackie

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2017 May 05, 2017

The placeholder is just text to help people understand what's required.

I use yourname@domain.com  as a placeholder which could be a valid address (I've never tested it) but anything's possible.   People scoop up the weirdest things.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 06, 2017 May 06, 2017

jackiea24857405  wrote

Your message to me/Osgood:

"You probably dont want to do use an email address as the palceholder text:

placeholder="yournameemail.com"

Rather:

placeholder="Your email adddress"

Jackie

I deleted that post as I didn't think it was particularly relevant. Myself I would not use 'yourname@domain.com as placeholder text in the email form field as its a valid email address and if the form Submit buttion is clicked the message will be sent to yourname@domain.com and the user might well think they have submitted the form with the correct information.

I would use something else like 'Your Email Address' as the placeholder text as its NOT a vaild email address and therefore if the Submit button is clicked an error will be evoked, which is what you want to happen to alert the user there is a form error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 06, 2017 May 06, 2017

Placeholder text is only displayed when the field is empty and hasn’t received focus. Once the field receives focus (e.g., you click or tab to the field), and you begin to type, the text simply disappears. It is not part of any form input and will never be processed as such.

Personally, I have no qualms in using yourname@domain.com as a placeholder.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 06, 2017 May 06, 2017

Im seriously freaked out about ordinary folk knowing what 'domain' is. I have had clients in the past asked what their domain name is even though they have a website.

There is also a possibilty that those who dont know could attempt to insert fred@domain.com or bert@domain.com which would be valid.

Personally l just think 'Your Email Address' is a lot less likely to be misunderstood but hey different strokes for different folks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 06, 2017 May 06, 2017

What do you use on the telephone placeholder?

And do you use patterns or regex on your phone field?

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 06, 2017 May 06, 2017

You know what, I don't know what you mean.  I realize HTML5 has changed a lot of things, so just understand that I haven't updated this and am not totally up on all HTML5, but trying to get there.
I originally set up the phone field with labels like this:

<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>

I am still learning HTML5.  I am reading over a chapter on Contact forms right now.  I see that the HTML5 forms use the "required" attribute when the information is required - i.e. email and name.  In the old code above, I guess I did not use a required attribute or a placeholder, but by placeholder are you referring to text that sits in the field before the person starts typing - that is kind of grayed out?  - is this what you mean? 

If so, I really don't know how that is set up.  Also, what is autofocus?  Just to align their cursor into the field?  I understand 'required' and 'autofocus' but not how to set up placeholder text.

If you want to explain, that might be helpful. I downloaded the PHP zip folder and am going to tackle that.  I was going to try out your basic HTML5 form code above, with the PHP script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 06, 2017 May 06, 2017

My question about the phone field was in response to Osgood remarks about the email field.   Sorry for any confusion.

Placeholder text is simply an indication to users of what info and format is expected.  It's not a value.  It disappears as soon as the user starts typing.

     Example:  placeholder="1-123-456-7890"

Autofocus gives focus to that field.

Required attribute means just that.  The field cannot be left empty.  If you try to submit the form with an empty required field, the browser will alert users.  Different browsers use different alerts.

Pattern attributes are used to restrict characters in the field -- alpha numeric or only alpha or only numeric, etc...

HTML input pattern Attribute

HTML5 forms are capable of doing a lot of self-validation.  Previously, you had to rely on client side scripts for all of this.   Better browsers means less reliance on extra scripts.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 06, 2017 May 06, 2017

I wouldnt use placeholder text at all if a form label associated with the form field is present. Its pointless and duplicates the information being requested. However if l did use placeholder text l would try to use text which is simple and easy to understand, not something which could easily be misinterpreted.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 06, 2017 May 06, 2017

What about the phone field?  Is there something different that has to be done for that?   And if I want to use an extension field?  Is there any other coding other than this needed for a number field in HTML5?

   <input type="phone" id="phone" name="phone" placeholder="your phone number" class="textbox" />

I am not making the phone field "required."

  Also, I noted in the book I am reading on HTML5, that buttons are referred to like this:

  <button type="Submit">Submit</button>

   Currently I am using input type=  like this:

<input type="submit" value="Submit" id="submit" class="formbutton" />


<input type="reset" value="Reset" name="Reset" class="formbutton"/>

    I am using a css class to stylize the buttons so they have a gray-green image background, so that is why the class= is in there, but I note when I try to convert this to a <button> tag, the button disappears:

<button type="submit" value="Submit" id="submit" class="formbutton" />Submit</button>

  What am I doing wrong?   The gray-green box around the button disappears, and the text ends up hanging out ot the right by itself.

  Here is the practice page I have set up -for reference: 

CJVolk Associates - Treasury and Cash Management Consulting Services

(I am probably going to remove the placeholder text, as I agree it looks redundant.)

Actually,  just looked at it myself online - and the Submit text does fall into the gray-green background, so I guess it just looks off in my Dreamweaver program.  This brings me to another question, if you don't mind.  Can I still use the Dreamweaver "onClick" event code with the buttons?

  Here is the coding that I have with Dreamweaver for the Submit buttons, how can I update these input fields to the HTML5?  You can see there are two hidden input fields - one is a sendtoemail and value with the email, plus a hidden redirect with value to the thankyou.html page.

The input buttons are taking on the number 2, because I currently have both forms on this practice page - it isn't the real Contact page.  But the onclick Dreamweaver code is coded into the Submit button.  Can this or should this be used when I install the PHP script?  How does it get rewritten into HTML5?

  Sorry to be so dense!  Just trying to learn.  Thank you for your help.

<input type="hidden" name="sendtoemail" value="name@cjvolk.com" />

                                     <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"/>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 06, 2017 May 06, 2017

Thanks Ben and Osgood.

What I am trying to do now is update the form script so there is no need to put in the email address at all.  I have found a free, online PHP script and am trying to learn how to install that.  My hosting company is not much help.  Yesterday, I found out that her email was also on a spam/blocklist, so that was another reason why she wasn't receiving messages.  The server was giving this message:

  xxxx@cjvolk.com does not appear to be a valid email address on this server (you cannot send to an external email address).

Could not get email address, or email address not valid. mailto{addr}

  I called them and they have unblocked it. We tried again to send message through the form and still get this same error. So now we think that it is in fact the script (javascript) or current form coding that doesn't work right - although the Submit and Reset buttons are working - so it isn't the Dreamweaver "onClick" script on the Submit button that is causing the problem. 

   Here is the solution I am going to try to use to set up a PHP script:  Download - Free Contact Form PHP Script | Fast Secure Contact Form

   I will see if I can get this working myself.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 06, 2017 May 06, 2017

Thanks again everybody, and Nancy latest.  Thanks for explaining the placeholder, autofocus, required and pattern.  It might be a nice idea to use pattern with the phone field, since that should be all numbers, but again, am not sure how to implement it.  I looked at the link you showed.  They give examples for passwords and country codes, but not phone numbers. 

How would you do a pattern for a phone number?  Not that I necessarily need it - the placeholder is good too, but I thought it might be useful, so somebody doesn't put in bogus text or something like that.

They gave an example for a password, using six or more characters.  Could this be used for a phone number?

   Password: <input type="password" name="pw" pattern=".{6,}" title="Six or more characters

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 06, 2017 May 06, 2017

Do not force a user to supply a phone contact number unless you are selling something via your site. Its highly likely to annoy the user to be required to provide a telephone number as they are fearful of cold calling.

None of the information you  gather from your form is guaranteed to be correct - a user can send what they like, hopefully some of it will be good enough for you to do something with.

I would just check to see if at least a valid email address has been provided, plus a name and enquiry. Leave fields like phone numbers to the disgression of the user unless its required in the example of a user having purchased a product in which case the user will most likely have no objection to providing their phone number.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 06, 2017 May 06, 2017

If your phone numbers go into a database, then setting some restrictions is probably a good idea.  International phone number pose a major obstacle for some programmers where you might encounter an input field with this:  011 +1 (123) 456-7890 x20

<input type="tel" restricts input to numerals.  BTW it's also great for US zip codes.

If the Tel field is not required (and in most cases it shouldn't be), I would just let them put whatever they want into it with a character minimum of 10 (US area code + phone number).

<input type="text"

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 06, 2017 May 06, 2017

<input type="tel" restricts input to numerals.  BTW it's also great for US zip codes.

Canada's postal codes include letters.

I don't use any pattern matching for phone numbers because with international numbers, there are too many ways the user may try to enter the number. I think it's better not to frustrate the user.

And the HTML5 email pattern matching rejects non-latin characters that are valid for email addresses. In fact the PHP email validator also rejects valid email addresses.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 06, 2017 May 06, 2017

Whilst not specific to your problem, do remember that the more information you collect from a user, the more you have to protect that information.

Most countries have some form of data protection act. This means that you or your client is responsible for protecting that information, no matter how it is used or how it is stored. There is also no minimum amount of information before it is covered by the data protection laws, 1 or a 1001+ .

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 11, 2017 May 11, 2017

Thursday, May 11, 2017 at 5:36 p.m.

Hi again, all -

Sorry I did not reply sooner - I have been super busy and had to put this on hold for a few days.  But I have read all of your helpful posts, and really appreciate the advice, and thank you for all of the helpful advice regarding phone numbers and emails.  I think the best option is to make the phone number field optional (1) as you first suggested, then to make it an input type="text".  What I am having a bit of trouble understanding is if I should be using both a value and a placeholder, for each field.

(Problem #2)  the PHP script doesn't work with my form...
After working on building out this form in HTML5, (and changing my HTML page to a <!Doctype="html">)
, I tried unzipping the PHP form builder that I had downloaded - a free one that I found online.  It comes with an admin panel, where you set all the fields, etc.  So I have activated the installation of it - which went fine; then started inserting a javascript code in the <head> area, as well as another PHP script in the body, where the form is supposed to appear.  You can have more than one form on your page, but have to number them. Plus, there are numerous other settings in the admin panel, which I am trying to figure out still.  Some of them are obvious, others are not.  It also comes with a captcha.  Here's the problem - the form that I built out, using Nancy's HTML 5 format she posted earlier, does not work now with this PHP script I have downloaded.  It is supposed to generate it's own form, the fields for which are controlled and inserted through the admin panel.

I want to  use the form that I built with the basic HTML 5 code that Nancy originally helped me with that I have worked with and show below, but I don't know how that can be done with this PHP form builder script.  So do I look for another type of PHP script to get my form working?  If so, I am not sure where or what I need to look for, that can be used in connection with the HTML 5 form I built out - which I show the code for below.

   My form has progressed a bit since I was last here on the forum talking to all of you, so now the code looks like this:

<form method="post" action="FORM_PROCESSING_SCRIPT_GOES_HERE.php">

                   <blockquote>

                     <p align="left">
<label for "Fullname">

<span class="formtitle">* Full Name: </span>

</label>

                       <input type="text" id="name" name="name" value="enter first and last name" placeholder="First & Last Name" required="required" class="textbox"/>

                       <label for="phone">                 

                       <br /><br>

                      <br>

                       <span class="formtitle"> Phone:</span>

                       <input type="text" id="phone" name="phone" value="~ phone is optional ~"     placeholder="123-456-7890" class="textbox" />

                       </label>

                       <br />

                       <br />

                    

                       <label for="email">

                       <span class="formtitle">

                      <br />

                      * Email Address:</span>

                       </label>

                       <input type="email" id="email" name="email" placeholder="youremail@email.com" value="enter your email" class="textbox" required/>                   

                     </p>

                        <label for="message">

                          <div align="left"><br />

                            <br />

                            <br />

                            <span class="formtitle">                       

                              * Questions and Enquries:</span>

</label>

                            <p align="left" class="textbox">

           <textarea id="message" name="message" cols="40" rows="8" wrap="virtual" class="textbox"
            required />                          

                             </textarea>

                           </p>

                             <br />

                             <br />

                             <input type="submit" value="Submit" id="submit" class="formbutton" /></button>

                             <input type="reset" value="Reset" name="Reset" class="formbutton1"/>

                             <br />

                             <br />

                             </p>

                         </blockquote>

               </form>

Finally, I am also trying to determine if the code above is correct.   For example, can you use both value and placeholder on all of these fields?
I tried using placeholder text in the Comments/Questions textarea, and it did not seem to work to have auto generated text in there.  Also, when you say "required" what is the proper way to use that in the code?  For example, is this correct to have required="required"? :

<input type="text" id="name" name="name" value="enter first and last name" placeholder="First & Last Name" required="required" class="textbox"/>


Or should it just be this  - as it appears in my email field:

<input type="email" id="email" name="email" placeholder="youremail@email.com" value="enter your email" class="textbox" required/>

You can see how the browser is displaying all of this here, on my practice page:   CJVolk Associates - Treasury and Cash Management Consulting Services          

Many thanks again to all of you for your help.  I was busy for a couple of days, and could not get back to this.  I know you're busy too - so I will check back in a little while, or wait to hear from someone.  Thank you again for helping me with this!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines