Make Gravity Forms Hidden Field Required? - wordpress

I have a Wordpress site that uses Gravity Forms, including hidden fields which are required for proper functionality. Is there a way to make hidden fields on forms built with gravity forms required?
I will be sending out an email with a URL linking to this form which auto-populates these hidden fields. However, I'd like to make these hidden fields required, or prevent the form being submitted if these hidden fields are not set, which may happen if a user navigates to the form manually instead of navigating to it via a generated URL.
I wish to avoid the perception that the form has been submitted when it has only been submitted with partial information.

The simplest, code-free solution would be to use conditional logic to only show the submit button if your hidden fields are not empty. Here's what the settings might look like:
You can take this a step further and use the opposite conditional logic to show an HTML field with a custom message letting the user know why they can't submit the form.

a hidden form element can't be required.
elements of type hidden let web developers include data that cannot be seen or modified by users when a form is submitted.
Source
If you put a hidden value, make sure you put it with a value to be sent or make sure that before submit, via javascript you edit that value.

You can now use two CSS classes to hide your field:
"gf_hidden" or "gf_invisible"
It won't show the Validation Message if it isn't filled though, so the user may not know what is missing from the submission:
The folk at Gravity Perks have a nice page explaining it in more detail though.
https://gravitywiz.com/how-to-hide-gravity-forms-product-fields/

Related

Contact form 7 file field related query

We have required conditional file field that depends on another dropdown field. If dropdown field value YES then file field will show and added required option but if dropdown value NO then file field not show and remove the required option.
We have done the hide show logic in file field but not able to do required option on off. Can anyone please suggest how to do that?
Without the exact website link, it is difficult to explain perfectly. However, from what I understand what you need to do here is to implement a custom validation.
You can refer this link to understand how to implement custom validation.
Basic flow of code:
1. Give ID to the drop down so that you can bind an onchange event with it
2. Bind an onchange event that hide/show the file field
3. Create custom required validation which checks your drop down value and decides whether the other field is required or not
This should do your job... Feel free to ask other questions and post your website uRL and code to get a better answer.

Add searchable textbox with typeahead to form

I have a form in an asp.net mvc view.
The form contains a textbox which is used to edit the username property of my model.
I want to add the bootstraps typeahead to this textbox searching the users while typing.
As far as I know the typeahead should post a form, but I can not put a form inside a form (since I want to use the typeaheads search result in form postback).
How can I solve it? Can it be done without using Ajax?
EDIT:
It's important that the selected username influences the content of the form. So somehow I have to post the typeahead selection, which in the server modifies the model and the result is an updated form. After that the user fills the remained fields than posts the form.
Typeahead can work on any <input type="text">, you should inspect the element in the examples. When you do you will notice that the input has a data binding called data-source which is just an array of strings. It then filters those strings whenever you type.
You could certainly populate that array via ajax. You might want to find some way to disassociate that <input> from the form though. Although it's probably not a big deal breaker.

Conditional field using dynamic vocabularies to custom fields on ##register

I'm following collective.examples.userdata to add some custom fields on the register form.
I want to add two fields, one for state and another for city, where the second load content based on the previously selected state.
My question is how it is possible, can do this only with the schema, using dynamic vocabularies or is need to edit registration form? How can I do it?
Another issue is how to load the registration form in a portlet. Is Possible fill the ##register viewlet?
Thanks!
Use javascript to do the dynamic part of the secondary field. To render the form inside a portlet, there are a couple of ways to do it but again, using javascript might be the easiest. You have place a register button that opens a registration overlay.
Take a look at http://plone.org/products/plone.app.jquerytools for how to wire it up.

Infopath Send Current Form to Different Form upon Submission

I have an infopath form, is there anyway to get this current infopath form and once submit is clicked, have it go to another form or show a different set of fields upon press [submit] ?
Thanks
If what you want to achieve is some kind of multi-step form, you could use views. InfoPath Views allow to display different fields depending on the view, and you can add buttons to navigate from one view to an other. You may also evaluate some rules before switching to an other view (for example to check for mandatory fields).

Drupal Modify Login System

I'm newbie in drupal...
I have a drupal website, and i want to extend its login system - i've been looking around the code but end up with headache.
what i wan to do is:
I want to put additional hidden form inside any login form
create a session variable that will be used on login process (after user click submit) and then destroy the session after that.
extend the login validation system inside drupal based on point 1 & 2 above - so i need to to control if my extended validation is valid (and drupal validation is valid) then go to where? otherwise then go to where?
so with that I'll have my own login system + drupal login system
Is somebody ever try this before?
fyi: I'm using drupal 6
Thank you in Advance for helping me
And
To modify the login form, you will likely need hook_form_alter() and knowledge of the Form API
You can add additional elements to the login form, including hidden fields. Hidden can either mean hidden html form elements (<input type='hidden'/>) or values that are not output in the HTML at all but are stored server side for the corresponding validate and submit functions.
You can add additional functions to $form['#validate'] to change the login criteria (whether the login is accepted or not)
You can add additional functions to $form['#submit'] (note the '#') to add operations to perform after the user's login has passed validation. The default submit handler, user_login_submit(), simply redirects the user to their account page.
You should also consider checking http://drupal.org/project/logintoboggan . Logintoboggan is a module that tweaks and changes Drupal's default login by adding a lot of features. You can see how they achieved certain functionalities by reading the code. That will help you when you write your own code.

Resources