I have a static website with a contact form developed using drupal 7. When a user enters an email address, name, subject, and text, a copy is automatically sent to the sender. How do I disable this feature in the code side? I couldn't find this feature on the admin side in drupal.
By default there is one checkbox called 'Send yourself a copy' is on contact form which is by default unchecked. As i can see it is not visible in attached screenshot. Maybe it hidden because of captcha.
Or else we can alter form using hook_form_alter on .module file and add following code.
if ($form['#form_id'] == 'contact_site_form') {
$form['copy']['#access'] = FALSE;
}
Related
I have a requirement of verifying user's email id without registration or signup.
When user will complete the CF7 form, on form submit he should receive a link with some unique number in mail. And after clicking on that link he should be redirected to result page.
Also the click should be tracked back and update some flag in database.
I know WordPress but this requirement is completely new for me.
Please give solution how I can achieve this in above mentioned or other manner. Email verification is on priority.
TIA
1 solution is to create a page template & pass user Email via GET parameter & use that email to save in the database. You can write the code in page template for that.
Now to send link to the user, you can use contact form hook
function action_wpcf7_before_send_mail( $contact_form ) {
// Generate unique id
$unique_id = uniqid();
//Get user email & send link using wp_email()
//Link format - https://yourwebsite.com/your_page?email=$user_email&unique_id=$unique_id
//your_page will be the page template you create
};
add_action( 'wpcf7_before_send_mail', 'action_wpcf7_before_send_mail', 10, 1 );
Once the user click on the link then the code inside page template which you have written to save email in database will run & save the email on database. This logic i used once it works for me
I am really hoping someone can help. Searched my heart out, but didn't seem to find anything on this.
What I want to do is:
User is in a page where cf7 is, and fills in details. I then redirect the user to a separate page using on_sent_ok: "location.replace('pageurl');"
How do I display the value of the user input name on the redirection page?
If you don't want to do any programming or need your client to be able to easily edit what is on each page of the form you can use the following plugin:
Contact Form 7 Multi-Step Forms
You can just add tags to the form builder that will separate pages. I chose this plugin because I wanted my client to be able to edit the form easily. If you use the code mentioned by purvik7373 you will need to make the updates to change form fields.
First change the on_sent_ok to:
on_sent_ok: 'my_custom_redirect();'
then create that my_custom_redirect() function in the page that displays the form:
<script>
function my_custom_redirect() {
var your_name = document.getElementById('YOUR_NAME_FIELD_ID').value; // get value from your input field (YOUR_NAME_FIELD_ID) id
var url = 'https://www.example.com/?name='+your_name+''; // your redirection url
window.location = url;
}
</script>
I have page with multiple forms, which are hidden based on what link is active. One of these forms is using redactor and I want to send the user back to this page with the redactor form open on submit. By default the page refreshes on submit and it shows the default form for that page. I couldn't find anything about this in the docs. If anyone knows how to accomplish this please let me know. Thanks
To solve this you need to use window.location.hash with this you can send a hash variable to the URL when you click on the link to get to your form.
The urlHash works as follows:
var UrlHashVal = window.location.hash.substr(1); //get the hash value and store as a var
$('form').hide(); //hide all forms by default
$('form#' + UrlHashVal).show(); //show the form whose id matches the hash value
What this does is enable you to send a link to someone, like http://ucanstayatthe.ym.ca#myForm and it will open that page with form#myForm on display.
Now all we have to do is enable this urlHash to work within the page as well. On the page we show/hide the forms based on links. All we need to do is write the formID to the URL from the link. To do this simply add the fromID to your href eg. "#myForm". Now when you click that link it will display #myform at the end of the windowURL.
This solves all of the problems because now when the page refreshes on the Redactor submit, it will reload the URL including the hashValue that you have written to it. SO instead of reloading http://ucanstayatthe.ym.ca it will reload http://ucanstayatthe.ym.ca#myForm which in turn will show the correct from.
Bingo
I want to customize the user/register form.
When the anonymous user goes on this page I don't want to show the tabs Create new account, Log in, Request new password, and don't want to see the fieldset Account information with a username and email.
How can I do it in Drupal 6?
The tabtamer module lets you control what tabs are visible from the admin pages.
I'm not sure if it's possible to remove the user profile page entirely, but a module like login_destination or logintoboggan let you control where the user goes when they log in.
hii i am new to web site development
there is a login page in my web site which is in ASP.net(C#.net) . After entering the username and password and user click on the Login button . The user name and password got check and it shows the message at the "the user name and password did'nt match" but i want this messageas a message box. Currently it is showing as a line on the left-top corner of the page..
if possible so please give the code
You would have to put code in the LoginFailed event handler for the login control (if you are using the .NET framework login control, if not, proceed below). The login control's template also has an error label that you would have to inspect the control's children for to hide since you don't want that to display. In LoginFailed, or if you have your own UI login form, you can write out a message to display via:
Page.ClientScript.RegisterStartupScript(this, "error", "alert('The user name and password could not be verified');");
You will have to draw your own message box using HTML formatting (maybe a formatted div element), or use javascript's alert box to do so if you're shooting for a quick solution.
alert('Error','The Username and Password didn\'t match.');
ASP.net outputs HTML to the browser, so if you don't have formatting then the message will simply appear unformatted on the page.