Jump to content

[Resolved] Contact form issue


keat

Recommended Posts

I've copied the html from the contact form, cleaned and removed multiple contact entries as I want to have a contact form on a document page.

But for whatever reason, and I can't figure out, it's messing up.

<form action="https://www.xxxx.uk/index.php?_a=contact" method="post">
    <div><label for="contact_name">Name</label><span><input type="text" name="contact[name]" id="contact_name" value="" class="textbox required" /></span></div>
    <div><label for="contact_email">Email</label><span><input type="text" name="contact" id="contact_email" value="" class="textbox required" /></span></div>
        <div><label for="contact_dept">Department</label>
      <span><select name="contact[dept]" id="contact_dept" class="textbox required">
        <option value=>Tyre Enquiries</option>
              </select></span>
    </div>
        <div><label for="contact_subject">Subject</label><span><input type="text" name="contact[subject]" id="contact_subject" value="" class="textbox required" /></span></div>
    <div><label for="contact_enquiry">Enquiry</label><span><textarea name="contact[enquiry]" id="contact_enquiry" class="textbox required" cols="40" rows="7"></textarea></span></div>
    <div><input type="submit" class="button_default" value="Send Message" /></div>
  </form>

 

When I'm in the document dersigner, the "Send Message" button jumps out of the design area and takes up the place where the save document button should be.

Can anyone spot why ?

Link to comment
Share on other sites

I'm thinking pasting some kinds of code into the editor's Source mode is not the optimum way to do it.

When CKEditor then wants to show it, even though the editor's compose window sits inside an iframe, certain of that HTML does interfere with the HTML of the rest of the page.

Try composing the form using the editor's tool buttons.

 

Link to comment
Share on other sites

In admin, Documents, click the Edit icon of any document.

On the next screen click the Content tab.

Are you presented with a text editor having three rows of toolbar buttons?

If so, on the top row, the right-most group of buttons are those that let you build a form.

If there are no toolbar buttons, then we need to figure out why there is no 'rich-text' editor showing.

Link to comment
Share on other sites

Mine is missing something ??

 

The site is running 6.10, I have what I believe to be a clean version of 6.10 on a spare domain and this is the same.

I was going to try and perform an update on the spare, but this requires PHP 5.4, I'm still running 5.3.29 due to a few very old V3 sites.

 

so I copied includes/ckeditor folder from V6.13 to my test site and now these additional tabs have appeared.

Maybe 6.10 is missing these from CKeditor ??

formatting.jpg

Link to comment
Share on other sites

It was either CC609 or CC610 that since has the later version of CKEditor (indicated by the presence and use of the 'moono' skin - toolbar is black and white).

So, your experience is strange.

But, you say you now have the (stark-looking) CKEditor available?

Link to comment
Share on other sites

Please know that CubeCart considers a Site Document as simply plain content. CubeCart has recently implemented the option of passing that content through the Smarty parser to solve display logic decisions. Any PHP programming related to the form will need to be done prior to acquiring the document from the database.

CubeCart does not provide a way to evaluate PHP statements that may be present in a document's contents.

On the other hand, Smarty does provide a very limited ability to use some PHP commands. (On the third hand, Smarty allows for third-party plugins that will do whatever can be programmed into a PHP script.)

On the fourth hand, there is a hook available that can manipulate the document's content prior to assigning it to Smarty's variable array.

So, please let us know what you are wanting to do and maybe we can determine the best approach.

Link to comment
Share on other sites

I'm still having a few issues with the form builder, in the respect that I design the form, and then if i want to go back and maybe add any aditional fields, then submit button jumps out of the box again. This then effects the save button, meaning that you can't make any additional changes.

So either I lose all my work, or now have to copy and past the source html code.

Staus Quo.

edit: It seems that the issue starts when I add a text area, adding text fields is OK

 

As for the PHP side, I've got this working, but for the life of me can't get the formatting to work.

The data is coming back as a single string.

Link to comment
Share on other sites

I basically created a new document which contains a contact form.

It's related to vehicle tyres, the customer completes the form with his requirements: we shop around and call him back with a price.

My php email post script currently looks like this.

 

<?php
$ToEmail = "[email protected]";
$EmailSubject = "Tyre Request";
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";

$MESSAGE_BODY = "".$_POST["width"]."" ;
$MESSAGE_BODY .= "-".$_POST["profile"]."" ;
$MESSAGE_BODY .= "-".$_POST["rim_size"]."" ;
$MESSAGE_BODY .= "-".$_POST["speed_rating"]."";


$MESSAGE_BODY .= "      Name :".$_POST["name"]."";
$MESSAGE_BODY .= "      Email :".$_POST["email"]."";
$MESSAGE_BODY .= "      Postcode :".$_POST["postcode"]."";
$MESSAGE_BODY .= "      Tel :".$_POST["telephone"]."";
$MESSAGE_BODY .= "      Info :".$_POST["info"]."";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>
Your message was sent
<?php

But the emailed detials look like this.

 

35-40-R10-P Name :my name Email :[email protected] Postcode :kk23 456 Tel :12121212 Info :more info

 

I'm no doubt doing something fundamentally incorrect, but i guess not knowing PHP, I could be excused.

 

 

form.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...