Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Making JavaScript and PHP play together

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Making JavaScript and PHP play together

Postby brownie124 » Mon Jun 09, 2003 7:10 am

Hi,

This is similar to an earlier post. I have built this nice DHTML tab control. Each tab has a number of fields that are loaded something like:

Code: Select all
<td align="left"><input type=text name="txtFirstName" size=25 maxlength=25 title="Enter first name" tabindex=1 value=<?=$g_TBDispFirstName?>></td>


This is the scenario:
I bring it up and $g_TBDispFirstName is set to something like "Charles" (executed a query to get the values). The user changes the name to "Charlie" then clicks and goes to another tab that executes some JavaScript code then brings up a different set of fields. The user then returns to the tab with the code above. The JavaScript code displays the innerHTML that of course has the original value of "Charles" and not the modified value of "Charlie".

How can I update values between PHP and JavaScript? In this case when they click to go to another tab after modifying the field, I need to modify $g_TBDispFirstName before going to the other tab.

Any help would be appreciated. I am kind of under the gun here.

Thanks,
- Brownie
brownie124
New php-forum User
New php-forum User
 
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Postby Redcircle » Mon Jun 09, 2003 8:34 am

if you are xfreing info from page to page I would use sessions to store the value of the name.

when you initiate the name variable you will need to output the info that was in the $_SESSION['name'] var.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.