Additional Attributes
sean created the topic: Additional Attributes
Hi,
Does anyone have an example of the "Additional Attributes" field being used successfuly?
I want to restrict certain values in a date field, and I am hoping this may do it .
Thanks in advance,
Sean
Please Log in or Create an account to join the conversation.
11 years 7 months ago
Administrator replied the topic: Re: Additional Attributes
Dear Sean
To run a script before submission, you need to
- add a custom button instead of standard "Submit and Reset".
- assign a custom function name to OnClick function attribute of the button.
- define the function in the "Edit JavaScript" page. In this function, you can perform the required validation and submit the form using the function call check_required('submit') which will perform the standard steps and submit the form.
--
Best regards
Web-Dorado team
Please Log in or Create an account to join the conversation.
- Administrator
- Offline
- Administrator
- Posts: 800
- Thank you received: 62
11 years 7 months ago
lukask replied the topic: Re: Additional Attributes
Admin,
could you please give a hint, how to add an "onclick" conversion tracking (I use Google Analytics)...
thanks, Lukas
Please Log in or Create an account to join the conversation.
11 years 6 months ago
Administrator replied the topic: Re: Additional Attributes
Dear Lukask,
you can add an additional attribute with name OnClick and the value is the javascript function which you want to work onclick.
--
Best regards
Web-Dorado team
Please Log in or Create an account to join the conversation.
- Administrator
- Offline
- Administrator
- Posts: 800
- Thank you received: 62
11 years 6 months ago
lukask replied the topic: Re: Additional Attributes
Thanks for the answer.
Can you help me with a format with the javascript function?
I have "onclick" as a name and "_gaq.push();" as a value. But if I click on a send button, nothing happens now...
Thanks
Please Log in or Create an account to join the conversation.
11 years 6 months ago
Administrator replied the topic: Re: Additional Attributes
Dear lukask,
The function "_gaq.push" does not submit your form, so if you set that function to the onclick attribute of a button, this button will call that function, but will not submit the form. If you want to call this function and then submit the form, you should define a new function in the "Edit JavaScript" page:
for example
function newFunction()
{
_gaq.push();
check_required('submit');
}
Then you should assign the function newFunction() to "OnClick function" attribute of the button.
Best regards
Web-Dorado team
Please Log in or Create an account to join the conversation.
- Administrator
- Offline
- Administrator
- Posts: 800
- Thank you received: 62
11 years 6 months ago