CF7 Submit Popup - plugins

I have six CF7 forms and I would like to make a popup on particular form after submitting it. Contact Form 7 Response Colorbox Popup won't do since it affects all forms. Can anyone help me, I'm not that familiar with jquery but if someone can guide me it will be a great help. Thanks.

Try contact form DOM Events
document.addEventListener( 'wpcf7submit', function( event ) {
switch(event.detail.contactFormId){
case "220": case "222":
//show popup
break;
default : console.log("Error");break;
}
Find your id from shortcode :
[contact-form-7 id="223" title="Careers Entry Form"]

Related

How to make modal close after validation using Vue js?

I am using <q-modal>(Quasar Framework) for a form. On clicking Add button a form will pop over. In this, I am validating each form tags, after clicking submit button. To close the modal, I am using #click="$refs.maximizedModal.close()" for submit button.
Everything works fine. Now I need to retain modal if the validation is not returning true or if validation satisfies then the modal need to be closed.
Is there any method to do conditional submit in Vue js?
You should make a custom function for the submit of the form and use it, something like this :
....
methods{
checkForm(e){
if(VALIDATION_IS_TRUE){
//Validation has passed, we submit the form OR close the modal
$refs.maximizedModal.close(); // Maybe this.$refs.maximizedModal.close()
e.target.submit();
}else{
//The form is not validated, do something to inform the user
}
}
}
and instead of using the #click for the submit button, add this to the form element :
<form #submit.prevent='checkForm($event)'>
Hope this helps!

How does one prevent the submission of a webform if none of its radio buttons are checked?

I have a form with three radio button options, and a "submit" button (no checkboxes, no text fields). Yet if a user clicks the submit button, without choosing an option, the form still submits it, picking the first option anyway. What's the best method to prevent a form from being submitted if the user DOES NOT check any of the radio buttons? (My CMS is ExpressionEngine, and this form is generated using the CartThrob extension, just FYI. But it's not a CT issue as far as I can tell.)
With jQuery you can return false if there is no value for that input.
$('form').submit( function() {
if ( !$('input:radio[name="myRadio"]').val() ) {
alert('Fix this!');
return false;
}
});
You may need to change ! to =='', but that's the idea.

nyroModal v2: How to validate form opened in iframe?

I'm trying to figure out how to validate a form opened using nyroModal.
The page is being opened as below on click of a button:
$(function() {
$('.btnedit').click(function() {
$.nmManual('form_page.php);
});
});
On the form that opens up, I have a few fields that are mandatory and a cancel & submit button.
<a class="nyroModalClose button" href="#" id="btn_submit">Submit</a>
On clicking of the submit button, I want to make sure the mandatory fields have value. If no, an error message should be displayed & the modal window should not close.
I'm trying to use the jquery validation plugin, but without success. The modal window always closes irrespective of the validation scripts.
I haven't found much info regarding form validation in a modal window. Is this not a preferred approach?
Thanks in advance.
I'm not able to help you about the jquery validation plugin in a modal window, but I know that using the instruction $.nmManual in that way, the form will not be placed inside the iframe tag, and if I remember correctly the content of new page will be added without header and body tags, so in a word incorrectly. I guess this can produce no validation.
To successfully open an iframe you need to use filters as described here:
Open iframe manually in nyroModal?
I hope this can help you.

JQGrid - Add buttons to a Form Edit dialog

I have been using JQGrid for about a year now and I love it. Just wondering if someone knows a way to add a button or two that will trigger my own code on a Form Edit page? Not on the grid itself - the edit dialog.
Would I just use the onInitializeForm event?
Thanks!
Jim
I used jQuery to do this. In my case I had a drop-down select item as a field on the edit for and I wanted to add a link next to it. I used the beforeShowForm event.
beforeShowForm: function(form) {
$("#MyDropDownList").after("<a href='#' id='link'>A Link To Something</a>");
},
Hope this helps, even though it's a few weeks late.

FBJS/FBML: Display a textbox on click of radio button

I want to use FBML as a canvas and would like to display a textbox on click of radio button.
Can anybody out there help me out on this? e.g. if a user selects other as option it should make appear a text box. Is it possible? how? I'm eager to learn more from the responder.
yes it is possible .
Step 1 : make a div and put text box code into that div , and assign any id to the div let say id ="textbox". and in style attribute to the div put display='none' and call below function on onclick of the radio input
function showBoxt(id)
{
obj=document.getElementById(id);
if(obj.getStyle('display')=='none')
{
obj.setStyle({display:'block'});
}
else
{
obj.setStyle({display:'none'});
}
}
i was just looking for the answer for this question as well.
and i found a useful link here.
thought i might share it.
i've tried and tested, the animation just makes it look slicker :)
function showdiv(id){
var elm = document.getElementById(id);
if(elm.getStyle('display') == 'block'){
Animation(elm).to('height', '0px').to('opacity', 0).hide().ease(Animation.ease.end).go();
return false;
}else{
Animation(elm).to('height', 'auto').to('opacity', 1).show().ease(Animation.ease.end).go();
return false;
}
}
<div id="about" style="display: none">
Facebook is a social utility that connects people with friends and others who work, study and live around them.
People use Facebook to keep up with friends, upload an unlimited number of photos, share links and videos, and
learn more about the people they meet.
</div>
Show Content.