I followed the example here Yii2, feedback form in a modal window and I was able to create a contact widget that I added it above the footer of multiple pages on my website using the code <?= FBFWidget::widget([]) ?>.
I stripped the code of the modal box so I am not using that. The problem I am facing now is that whenever I opened a webpage, the page jumps straight to the contact form at the footer instead of showing the top of the page as a any normal browser should do.
I followed all the code as explained in the tutorial so I do not want to post all the codes here. Please see the tutorial
How can I stop this problem.
You are using autofocus property on the contact form field name which is forcing the page to go down as the cursor is focused inside the input field, you should remove that property or bind it only if the page url is /contact-us or whatever you are using for the contact form.
Related
I am working on a website which is designed in wordpress. In my one page i have a form included which is
[contact-form-7 id="144" title="Contact Form"]
No from one page i want to redirect to this particular id, for which i am writing
<href="http:my_url/contact#144"> which is not working
i have also tried
<href="http:my_url/contact.php#144"> but giving me page not found 404 error.
So what i am doing wrong that i am not able to detect.
That ID is only the ID of the form you're pulling in, referenced internally by the plugin - it isn't output on the element itself. If you go into the inspector, it'll be something like wpcf7-f482-p481-o1, only with different letters/numbers after wpcf7. If you want to make a prettier link, just wrap the embed code in a div with an ID of your choosing and use that on the anchor.
You can't do this on a contact form 7 id.
Try:
<div id="cForm">
[contact-form-7 id="144" title="Contact Form"]
</div>
Then link to with Contact form
I'm building a WordPress site with a modal window for entering search terms. On submit, the modal window is supposed to close and the search results are returned on the search results page.
I've tried WordPress' native search functionality (4.7), as well as Search Filter Pro (2.2). Both search forms work correctly and reroute if they are used in the main content area, NOT in a modal.
example.com/search/?_sf_s=pigs (I cannot show the dev site without client permission)
But when using the modal window, upon submit, the page does not redirect, but the URL query changes to:
example.com/?_sf_search%5B0%5D=pigs&_sf_submit=Search
I'm using Bootstrap 3 for the modal, but I've also tried another jQuery plugin (leanModal.js). Both of them reproduce the problem in the exact same way.
Is there a fundamental problem with submitting a form in a modal window? Is the closing of the modal window triggering a callback that somehow prevents the form _POST from firing? Has anyone encountered this problem before?
Any feedback would be appreciated.
Thx,
Michael
I have created a single page portfolio template using Bootstrap framework from Twitter. I am having an issue that when I click on "Submit" button in the contact form, the page scrolls all the way to top. I have checked that I have not used any internal linking to top so I am not sure why this happening. My intention is to stay on the same page and show user some friendly message. Can anyone help me figure out the issue? Thanks in advance!
Template can be accessed at:
https://rawgit.com/gupta235/portfolio_template_bootstrap/master/index.html
I have made the template available on my github page: https://github.com/gupta235/portfolio_template_bootstrap
Forms typically send you to a new page. Since your form is all in one page, the "new page" its sending you to is the same one you were already on, and so it sends you to the first part of that page, which is the top.
You can prevent the page from scrolling to the top by giving the form an action ability that instead of sending you to a new page or the top of the current page, will take you to an id that you place somewhere on the page.
Same concept as putting an anchor point on your page and giving people an option to click a link that takes them to a certain part of the page.
For example if you change your form opening code from
<form method="post">
to this instead
<form method="post" action="#error-check" id="error-check">
This should take you to the form when you hit submit, instead of the top of the page.
A form without an action attribute is not a form, according to standards - and will actually cause a page reload in some browsers.. I've found that action="javascript:void(0);" works well.
There is a page with a webform, and I need to add the facebook conversion code to the header of the page that is shown when the form is submitted.
The problem is that they are the same page.
When I want to edit the page there is a 'Confirmation message' box, however that will add code to the <body> of the page and not the <head> as facebook asks you to do.
I also don't think i can put in the head of the page because then it will show up also when the form is loaded and not only when it is submitted.
I am also looking into the possibility of displaying it in the page only if the word "done" is in the url, but i'm not sure if that's possible, or if it's a bad idea.
Any help is appreciated.
Thanks
I ended up using php to check the url of the page, and since we had the word 'done' in the url after the form was submitted, I could then add the code i needed.
I'd like to create a custom field in Drupal 7. This field should have a textfield and a button, when the user click on the button, it open a popup which load an external page, this page generate a link. Then the user copy and past this link in the textfield.
My question is, how can I create this custom field which open a popup window ?
Any suggestions?
Have you tried using Colorbox for building modal ajax dialogs? You could put
the necessary fields inside the popup. It is working, and it is also easy to understand.
There are also other modules available like Modal Frame API, Chaos tool suite, Popups API, etc.You can find a lot of modules needed for your purpose.
The following links might help you:
https://drupal.org/project/colorbox
https://drupal.org/project/popups
https://drupal.org/project/modalframe