⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Jquery function - form validation



William Schoeffel

William Schoeffel
  • profile picture
  • Member

Posted 19 April 2013 - 23:48 PM

hey guys,

 

i'm having a problem in my form validation.

 

i have 3 fields.

 

total cost, number of payments, cost by payment

 

when the user type the total cost and select the number of payments, i want to calcule the cost by payment dinamicly

 

how i do that? where i call the jquery function?

 

i also want put a mask (money) in total cost field and i don't know how to do that either. 

 

sorry from my english, i'm from brazil!

 

awsome work with this CRUD by the way!

 


davidoster

davidoster
  • profile picture
  • Member

Posted 21 April 2013 - 00:25 AM

1. auto calculation of the cost (static inlcude), depending on the theme you use, you go to assets/themes/your_theme/views/add.php or edit.php and you include there your jquery. for dynamic include prepare the jquery code you want to have included and just before loading the view do this,

$output .= $my_jquery; // where $my_jquery is your jquery function

 

2. you can follow the previous technique and include all the appropriate javascript for the masked input (similar to the above 1) and you might want to call the callback_field for further customization


William Schoeffel

William Schoeffel
  • profile picture
  • Member

Posted 22 April 2013 - 12:48 PM

thanks man, you save my ass!

 

cheers from brazil!