I've been tasked with trying to find out whether I can create a select list in a form, and once one of the options is selected, the remainder of the form is changed to reflect the selection. I can't see any options to do this in Squiz and I'm not sure how I would go about it with JavaScript.
I also need to check the last character of a text field to make sure it is within a range of characters, e.g. a-k
I've tried "Must end with" but it only accepts 1 character, and trying to create multiple rules with multiple characters just makes the system argumentative.
Wow thanks Nic, that looks really simple, is it as easy to integrate with Squiz? There doesn't seem to be any way to access underlying CMS HTML code for forms and I'm not too clued up on the whole keywords business :)
Wondering how I would implement this through the CMS itself.
Wow thanks Nic, that looks really simple, is it as easy to integrate with Squiz? There doesn't seem to be any way to access underlying CMS HTML code for forms and I'm not too clued up on the whole keywords business :)
Absolutely there is a way to do it. You need to customize the Page Contents, then add your own HTML and keywords for the fields, labels, etc.
If you are nesting (multiple?) forms within another page's contents, how would this affect the submission of forms in regards to caching? Would there be any impact with submission if sending the data via AJAX and displaying the response so that the 'thank you' message doesn't take the user to a new URL?
If you are nesting (multiple?) forms within another page's contents, how would this affect the submission of forms in regards to caching? Would there be any impact with submission if sending the data via AJAX and displaying the response so that the 'thank you' message doesn't take the user to a new URL?
Generally nesting a Custom Form into another page doesn't work because of caching.
But, like you mentioned there are some other ways of doing this such as using ajax to post the values to the custom form URL.
The only problem I have is that if I don't nest the custom form within a standard page there is no way to apply the designs to the form that I would usually do through the standard page.
var val = $(this).val();
if (val == 't1') {
$('#test1').show();
$('#test2').hide();
} else {
$('#test1').hide();
$('#test2').show();
}
});
</script>
The problem I have now, is that the titles show, but the section contents never shows. Sorry for all this :D Just really want to figure out how I can make this possible.
The problem I have now, is that the titles show, but the section contents never shows. Sorry for all this :D Just really want to figure out how I can make this possible.
You need to make sure to wrap your jQuery code with the jQuery ready method:
$(function() {
// put your code here
});
jsFiddle just includes this for you, so that is why you didn't see it...
The only problem I have is that if I don't nest the custom form within a standard page there is no way to apply the designs to the form that I would usually do through the standard page.
Not sure why you mean by this. I don't see any reason why a Standard Page would be required. Can you explain more? I am sure this isn't needed.
I've created a custom form, but the website I am developing on has 3 or more custom design, 1 with just 1 column, one with 2, one with 3 etc (different variants). I tried changing the designs for the custom form and it wouldn't allow me, so I tried looking for the web path for the custom form and there is no option. So the only thing I could do was create a standard page, and nest the custom form in there.
What worries me is that in a previous post I think somebody mentioned not being able to retrieve the data from the form if it was nested on a standard page. I know nothing about AJAX or how to use it with Squiz.
Hey Nic, I found something troublesome when hiding the forms. It's fine that they're hidden from view, but when a user goes to submit, if the hidden form has required fields, then the form still asks for these to be filled in. Is there any way (Other than removing all required fields (which could be dangerous) that we can disable these forms from being taken into account when the entire form is submitted?
Hey Nic, I found something troublesome when hiding the forms. It's fine that they're hidden from view, but when a user goes to submit, if the hidden form has required fields, then the form still asks for these to be filled in. Is there any way (Other than removing all required fields (which could be dangerous) that we can disable these forms from being taken into account when the entire form is submitted?
Yes, you can make the field required, but then add a Condition that will check if the answer of the Select field matches a certain value.
I've created a custom form, but the website I am developing on has 3 or more custom design, 1 with just 1 column, one with 2, one with 3 etc (different variants). I tried changing the designs for the custom form and it wouldn't allow me, so I tried looking for the web path for the custom form and there is no option. So the only thing I could do was create a standard page, and nest the custom form in there.
What worries me is that in a previous post I think somebody mentioned not being able to retrieve the data from the form if it was nested on a standard page. I know nothing about AJAX or how to use it with Squiz.
It sounds like your Custom Form is placed in a location on the site that doesn't have webpaths. You need to move it to where you created that Standard Page that it was nested in so that it can have its own webpath rather than requiring nesting.
Yes, you need to be very careful nesting Custom Forms into Standard Pages, not a good idea.
How would I go about changing a form items required status using keywords? You've already shown me how to hide items depending on the select option, so I could use that same code, I'm just not so hot on the keyword manipulation.
How would I go about changing a form items required status using keywords? You've already shown me how to hide items depending on the select option, so I could use that same code, I'm just not so hot on the keyword manipulation.
What do you mean "using keywords"? Did you make the field as required and then add a condition?