Jump to content
Remitur

custom contact form?

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... 😟 )
 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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