|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Javascript code to word php
Hopefully you can make sense of my explanation.
I have two tables in the db. One for the user, one for codes and names. I have a search and the results are shown in a table. For most things, it just retrieves the information in the forms of words already, but for gender it is retrieving the code numbers. I need it to retrieve the name, not the number. I already have a function in another file, written in javascript that does this. My table on the site is set up to fetch objects... like this: [highlight=php] while ($obj=mysql_fetch_obj($result)) { $user = $obj->user; $place = $obj->place; $sex = $obj->sex; echo '<tr> <td><font size="2">'.($user==""?" :$user).'</td> <td><font size="2">'.($place==""?" ":$place).'</td> <td><font size="2">'.$sex==""?" ":$sex).'</td> <tr>'; } What i want to know is how do i call the Javascript function codetoword... I tried doing $sex = codetoword($sex); and it did not work. |
|
#2
|
|||
|
|||
|
RE: Javascript code to word php
|
|
#3
|
|||
|
|||
|
RE: Javascript code to word php
But no i already have the code to get the name of the sex.
ALl i need to know is how to call it from the object fetch or table??? I know javascript:codeToWord($sex) somehow works but where?? |
|
#4
|
|||
|
|||
|
RE: Javascript code to word php
The problem is that PHP is server side code and javascript is client side code. the Javascript does not get executed until the page loads. You can not call a javascript function from within PHP code as the javascript is not able to function until the page is loaded and the php script has already finished processing at that point.
|
|
#5
|
|||
|
|||
|
RE: Javascript code to word php
Ok so for any who wanna know i just went ahead and wrote another php function instead.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Javascript code to word php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|