in php, we have to use javascript functions, normally, user libraries make things easier.
but, do you have two different kinds of libraries: php library and javascript library, or just one?
if two, some functions in both libraries look very similar.
in my case, I created two, but when I modify one, I have to modify another one.
i.e. function checkEmail(..) is in both user libraries.
if one, how do you mix code? I can not think about it.
thanks
user libraries: one or two?
Moderator: General Moderators
-
php12342005
- Forum Commoner
- Posts: 79
- Joined: Mon Mar 21, 2005 3:35 am
What about a php library that outputs javascript code.
So you can write a function with the following syntax in php:
Then have that function output whatever javascript youre using to update form fields.
So you can write a function with the following syntax in php:
Code: Select all
update_form_field(form_name, form_element)- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I guess someone could (or maybe even has) write a class for that (form classes with JS validation included would be nice). Not something worth building into PHP though...jshpro2 wrote:What about a php library that outputs javascript code.
So you can write a function with the following syntax in php:
Then have that function output whatever javascript youre using to update form fields.Code: Select all
update_form_field(form_name, form_element)
I didn't mean building it into PHP, I mean a class or a list of custom functions if he's not into OOPd11wtq wrote:I guess someone could (or maybe even has) write a class for that (form classes with JS validation included would be nice). Not something worth building into PHP though...jshpro2 wrote:What about a php library that outputs javascript code.
So you can write a function with the following syntax in php:
Then have that function output whatever javascript youre using to update form fields.Code: Select all
update_form_field(form_name, form_element)