TOPIC:

Fire javascript 'on click' event within scipt piece before form 2 weeks 2 days ago #261350

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
in my before form javascript I set an html dropdown value if a url param is a certain value, this works fine but the on change event doesn't fire.

If i manually change the html drowpdown the event does fire.

How can i force the html dropdown "on change" event to fire so i can hide all controls i want it to hide and does hide when i do it manually.

Obviously i could duplicate code to hide the elements when i set the value but firing the on change event seems to be more elegant.

can i call the event?
ff_txtpasstype_action(this,'change');

something like that?

Thanks

David

Please Log in or Create an account to join the conversation.

Fire javascript 'on click' event within scipt piece before form 2 weeks 2 days ago #261352

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
Hi,

if you want to activate the script during changes on the element, in your case select list, you can do it on the way, navigate on your element, Advanced - scroll down to the ActionScripts and select type 'Custom' and Action 'Change' and insert this code:
function ff_nameofelement_action(element, action)
{
    switch (action) {
        case 'change':

//Inser your code

            break;
        default:;
    } // switch
} // ff_nameofelement_action

Instead 'nameofelement' insert the name of the element (not title).

And after any changes on your element, the script which you inserted in ActionScript will be triggered.

If you need more help, feel free to ask!

Regards,
Mirko

Please Log in or Create an account to join the conversation.

Fire javascript 'on click' event within scipt piece before form 2 weeks 2 days ago #261362

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
No no I know that. I want to fire that procdure ff_nameofelement_action ()

from within the script before form or after form of the form.

Thats what im asking.

so for exampel in the URL param string it says "passtype=Athlete" If that happens I change that dropdown to that value, but the ff_nameofelement_action doesn't actually fire from me doing that and it should (and would if it were VB.net or some other language and not javascript) is there some listener i can fire or something or just all the proc directly?


David

Please Log in or Create an account to join the conversation.

Last edit: Post by shinzan.

Fire javascript 'on click' event within scipt piece before form 2 weeks 1 day ago #261373

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
Hi,

ok, I sent you a link below, where is described where you can use JS and PHP script, please look at it, and if you have question feel free to ask!

crosstec.org/en/support/online-documenta...ript-and-pieces.html

If you don't help that, could you please export the form here and that I can better figure out what you want?

here on the link is explained how to create the package.

crosstec.org/en/support/online-documenta...ted/94-packages.html


Regards,
Mirko

Please Log in or Create an account to join the conversation.

Fire javascript 'on click' event within scipt piece before form 2 weeks 1 minute ago #261382

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
so i can say something like:

ff_getElementByName('FIELDNAME').onchange

or how would i fire the event of the control?

Please Log in or Create an account to join the conversation.

Fire javascript 'on click' event within scipt piece before form 1 week 6 days ago #261392

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6455
  • Karma: 3
  • Thanks: 456
Hi,

you can't do it on this way. In before form or after form must be php code, and this will not work code will not work there.

On click event you can use in Action Script using javascript or in Initialization Script with jQuery.

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.050 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!