Jump to content

custom contact form?


Remitur

Recommended Posts

There're various threads, previously posted in this community, about creating custom contact forms in WHMCS, with custom fields or others requirements.

The only proposed fixing are:

  • manage contact form as ticket in a specific deptm with custom fields
  • or create your own contact.php page

Just an idea, that I was not able to understand if doable or not (smarty is definitely not a great friend of mine): so, here I am to ask...

In contact.tpl there's just one text variable which includes the message from the customer, and which will be returned to the encrypted contact.php:

			<div class="form-group col-lg-12">
				<label for="inputMessage">{$LANG.contactmessage}</label>
				<textarea name="message" rows="10" class="form-control" id="inputMessage">{$message}</textarea>
			</div>
[...]							
			<div class="form-group col-lg-12">
				<button type="submit" class="btn btn-success btn-lg"><i class="fa fa-send"></i>{$LANG.contactsend}</button>
			</div>
	

I could easily add further fields in smarty forms, but the contents will be lost.

But... does exist any way to modify the "message" variable just before submit?

If it's possible, I could edit it concatenating to it the strings of further variables... and so getting a single string which includes all the custom fields I can add to the form...

(I did few tests, but just collecting different kinds of errors, without getting any real result... 😟 )
 

Link to comment
Share on other sites

4 hours ago, Remitur said:

Just an idea, that I was not able to understand if doable or not (smarty is definitely not a great friend of mine): so, here I am to ask...

I think Smarty is irrelevant in this situation...

4 hours ago, Remitur said:

I could easily add further fields in smarty forms, but the contents will be lost.

But... does exist any way to modify the "message" variable just before submit?

I might suggest Googling javascript and concatenating form fields / textareas and seeing where that gets you. 🙂

4 hours ago, Remitur said:

If it's possible, I could edit it concatenating to it the strings of further variables... and so getting a single string which includes all the custom fields I can add to the form...

I don't particularly see the point of this, except as a theoretical programming exercise, when you might as well just use the support ticket option... whatever you merge is going to be sent in the email to the customer anyway.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated