Multiple Salesforce Web-to-Lead forms - forms

I'm using a Salesforce Web-to-Lead form on a website i'm working on.
I want the same form to appear in 2 places, in the footer but also in a fixed position div.
Because the labels and inputs have the same ID they are conflicting with my form validation and behaving erratically.
Is there an easy way to fix this?
Thanks in advance,
George

Form key/value pairs (in HTML in general, not just SFDC of course) are submitted based on form element NAME attributes, not ID. So just remove the ID tags (or change them if they are being used by your custom validation).

Related

How to restrict filling duplicate entry in Google forms

I am working on a Google form where I keep receiving responses every minute. I want to restrict people in case if they are filling the response with the same unique id in column R.
So basically when anyone click on submit button, form should check the values in column R with the value in current form and restrict the user while filling up the form.
I tried doing this in Google form script editor but didn't get the exact code which can validate and stop the user while submitting the form.
Any help will be appreciated. Thanks in advance.
Sanjay
As Zig and Sandy mentioned it is not possible with live forms.
However you have the on submit trigger. You can write your script to look for duplicates of the last record when the form is submitted and in case there is any picks up the email (maybe a required field if they don't have to sign in to fill the form) and let them know their duplicated submit has been removed.

Marketo duplicated form validation

I have a problem with duplicated Marketo Form. I have 2 exactly the same forms on a page. First one is displayed in the content section of the page, the second one is diplaying in a popup when some button is clicked.
The issue is that when I submit the first form which is blank the validation messages are displaying for the second form in a popup.
I understand that the problem is that 2 forms have the same ID.
Is there a way to have 2 exactly the same Marketo forms working well on a page?
The problem is that when the Marketo form is embedded, it gives the <form> element a unique ID attribute based on the form ID. When you put the same form on the page twice, it puts two <form> elements on the page with the same unique ID, and - apart from that being invalid HTML - it means when you submit one form, it tries to submit both forms.
I'm not sure if it is possible - but there may be a way to use javascript to dynamically alter the <form> ID after it has been loaded into the page, therefore giving you two separate unique IDs... YMMV!
The only other workaround I've used was to duplicate the form in Marketo, and have a 'form A' and 'form B'.

Using ninja forms, how can I persist field values across pages?

I have a form on the home page of quotedjobs.com that I would like to persist the field values of across pages.
For example: A user enters some values in fields, such as job title (textbox), job type (list) and job description (text field). Underneath that I ask users to register on the site, but they have the option to click a link to allow them to login if they are already members.
What I would like to be able to do, is to redirect users to another form that is a copy, but allows them to login instead of register, but keep hold of the values that they entered in the title, type and description form of the previous page so they aren't losing their work.
I have seen the ninja_forms_processing variable in the docs, but I'm not clear on how to use that.
TL;DR - You can't.
As it was slim pickings here, I sent an email over to support. Got this response:
Hello,
At this time this use case is not possible in Ninja Forms. The plugin is currently unable to transfer data from field to field or between forms.
I’m sorry that we do not have a better solution for you at this time.
Thank you,

How to get browsers to selectively ignore HTML5 required attribute on forms

I've got a standard HTML form, which is split into two sections using fieldset elements. One section is to enter name, email address etc and the second section is to enter the postcode for an address auto-complete feature (the postcode lookup field in the second section does not have a required attribute).
Each section has its own submit button. Each of the fields in the first section has a form field with a HTML5 required attribute.
My question is, when a user enters their postcode into the postcode lookup field without entering anything in the first section, all fields in the form are submitted in browsers which don't support this attribute (e.g. Firefox 3.6). In Firefox 4 (for instance), it honours the required attribute and prevents submission of the form if there are empty fields with a required attribute. However, this breaks my implementation of the error-checking and validation of the form (server-side, in PHP).
So, is there a way of being able to tell the browser to (in this case) ignore the "required" attributes of the first section when the submit button of the second section is pressed?
I understand this may be going against the point of the required attribute, but I've built the form so it doesn't have to be completed in a certain order, i.e. A user may choose to complete the postcode lookup field before entering their personal details, but the required attribute is currently forcing the user to complete the form in a certain way, when it isn't necessary to do that.
Also, any solution must be able to work without JavaScript. Please don't mention any answers advocating replacing the postcode lookup section with Ajax, it has been decided for me that this is not an allowed option.
I think I see your problem. I don’t believe there’s anything in HTML that lets you specify this more complicated validation rule. I think you’ll have to either:
Split these fieldsets out into two separate forms on the page;
Use two separate forms on two different pages; or
Re-write your server-side code so that the non-postcode form fields only include the required attribute when the user has submitted a postcode.
Is there any nested form in your page?. first form tag not work in nested forms like below. in that case use empty form tag to avoid error. and also do not write class with form tag starting like form.filed{}
<form>
main form
<form> </form>
<form> form1 </form>
<form> form2 </form>
</form>

Make a "switch" in Zend Form to show/hide specific form elements

I have working user registration form.
It consist of Zend Form Elements.
Now I wonder what is the best way to modify this form in order to implement a "switch" in registration form. In other words user should be able to choose which fields to fill (there should be fields as for individual user and company; only few elements should change their labels and "required" state of a selected registration type) and accordingly of made choice validate appropriate fields.
So which is the best and not hard way to make it?
Maybe there are some tutorial or examples?
Thank you!
I think that the best place to change required" states and validators of your form elements is just before validating your form, i.e. $yourForm->isValid($_POST). In this place you would have to change the validators and/or required states of some fields. Which fields would depend on the value of registration type input form element.
As far as showing/hiding specific form elements goes, you could do it on the front-end side using JavaScript.