Disable form field google script - google-forms

I have a link that leads to a prefilled Google form, the prefilled form is editable and user can change the entries
I added a note not to change anything but of course user still has a capability to change it if they want to.
Is there a way to lock or restrict the user from editing the prefilled form?
The user need to see the fields with the prefilled content, but they should not be able to edit/modify it.

There is no way to use prefilled values with a standard Google Form without allowing the user to edit those values in the form. Consider creating a web app based form instead of a standard Google Form. See the Web App Demo for sample code.
In the event the prefilled values do not need to be viewed or edited, you can put the fields that that hold them in a section of their own. Then skip that section so that it is not visible to people who fill in the form.

Related

Create moderation for form data

I want to add moderation logic for a form which has name, mail and comment. Now when anyone fills the form and clicks "submit" it should directly be posted to the page. I want to send the content to "admin" and to be published after the content is reviewed. How can I achieve this in Drupal? I'm using Drupal 7.2.
There are many ways to achieve what you want. I guess you are looking for a site-builder approach.
Then you may have a look at the Webform module. Webform lets you build forms and define e-mail addresses to where the submitted data should be send to.
Then there is the Rules module with which you can define a rule that on every form submission automatically a (initially unpublished) node is being created populated with the form values.
And finally you may provide a list of all unpublished nodes built with Views. Maybe you already provide a button "publish" next to each node in the list that triggers the node publication.
Alternatively you may also have a look at moderation modules like Workbench Moderation.
Or have a look at the Flag module which is pretty useful for flagging content according some logic and/or button clicks. For example you can add a flag: approved.

How to programatically unhide Drupal 7 content field

On my company's Drupal 7 site, I created a field for one of our content types through the admin UI. We decided to hide it from the user until some styling changes make it through to production. Is there a was to programmatically unhide the field via an update hook? I know get at least some of the field information through the field_info_field function, but I'm not sure how if it contains the setting needed to make the field visible to the user. Any help on this would be appreciated.
I know I can unhide it through the UI once the changes hit production, but it would be nice to have an automated way of doing this.
You can hide it programmatically from it's node template with hide() function:
https://api.drupal.org/api/drupal/includes%21common.inc/function/hide/7.x
You can do that conditionally, i.e. by checking user role first.
Now, I'm not sure will this work from update hook, and I'm not even sure why you want to use that hook?!? If users are allowed to edit that content type and you actually want to hide it from edit form then check out my answer here:
Drupal 7 - Hide certain form fields of a content edit form depending on the content data
You can use https://www.drupal.org/project/field_permissions drupal module to hide and unhide fields to users of specific role.Initially during development the field can be made visible to admin role and then later on the permission can be granted to users of other roles

wordpress register form to salesforce

I'm wondering if it's possible to use a saleforce form for registering users on wordpress so that when a user registers on the frontend their details are sent to saleforce CRM?
The answer would vary depending on what form tool, if any, you're using, but lately I've been using Gravity Forms and have had great success with connecting to Salesforce via a custom Gravity forms redirect confirmation.
Once you have a form built in Gravity Forms, go to Form Settings > Confirmations. Edit the default Confirmation and change to Type "Redirect". You'll want to post the form to Salesforce's Web-To-Lead API, so enter https://www.salesforce.com/servlet/servlet.WebToLead in the Redirect URL field.
You'll then pass the fields you need via a query string, so check the 'Pass Field Data Via Query String' box, then configure the query string with Salesforce field names and Gravity forms merge tags. There are a couple required parameters including the encoding, your Salesforce Company ID, and a return URL to redirect back to after the form is submitted.
Leave off the ? to begin the query string, so it looks like
encoding=UTF-8&oid=0123456789&retURL=http://example.com
then add fields such as first name, last name, company, country, etc. by adding a parameter for each and selecting the appropriate Gravity Form merge tag from the menu on the right. It will end up looking something like
&first_name={First Name:1}&last_name={Last Name:2}&company={Company:3}
You can also send data to custom fields in Salesforce if you find the field ID. The easiest way to do this is by creating a Web-to-lead form in Salesforce and copying the field's name.
All together, your confirmation should look something like this -
For bonus points, you could add a hidden field to the form for the Return URL and populate it dynamically on the page, either by pulling the current page URL, or adding a custom field to choose a Return URL dynamically.
If you're not using Gravity Forms, you can still use Salesforce's Web-To-Lead tool by creating your own form, or using theirs, and sending the data in a query string.
There are various plugins that allow you to send data to Salesforce from a form, such as WordPress-to-lead for Salesforce CRM.
It is also possible to use the Salesforce API to build a single signon, and register users to or from either service. I built one for SugarCRM, which you can view the code for it at Github to get an idea of how it might work with Salesforce.

how to add phone field to interface create new lead marketo

it's possibe to add a field for example "phone field" in the interface for create a new Leads of marketo ?
Unfortunately there is no way to customize this Lead Creation widget.
What I'd suggest is to create a Marketo form and embed it on some internal page you have.
In this form you can include all the fields you want the marketers to fill out when they manually creating new leads - phone number for example.
TIP: Make sure you have some javascript installed on this page which removes the mkto cookie from the marketer's browser - otherwise, all his/her web activity will be associated with the newly created lead.

How I can add "files available for download" to Drupal user profile page

first time here. I have searched all day for my particular issue with no luck.
I have users that have specific roles auto generated (they purchase a game). I want to display files available to their particular role on their user profile page. I just want to know how I can add a generic view or associate a panel with user profile pages. I want this to display for every user, not on a per user basis. Basically it'll act like, say, direct2drive, you log in and go to your user profile basically and see what games you bought. Seems simple but I am having a heck of a time figuring out how to do this.
I am pretty used to using views but I just don't get how to edit the user profiles like I want to.
Thanks!
The simplest way is to install views_attach, and create a view with a Profile display. This displays the View on the user profile pages, rather than on its own page or in a block, and will pass the user's uid to the View as an argument.
Alternatively, if you're already using comfortable using panels, you can go to admin/build/panels and enable the Users panel. This replaces the user profile page with a panel, which you can add views, nodes and blocks to as normal.

Resources