SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 15th, 2004, 11:59 PM
mearnh mearnh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 30 mearnh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
I think I need some javascript?

I'm not even sure how to ask this. I think I needs a javascript function but not really sure.

I have a table comprised of some data pulled from mysql. only showing a handfull of fields, I have a button at the end of each row pointing to a seperate page pasing a value from one of the fields for that row?
make sense?......prolly not

code...
php Code:
Original - php Code
  1.  
  2. for($x=0; $x<$number_rows; $x++)
  3. {
  4.   $result_array = mysql_fetch_array($result);
  5.  
  6.   echo "<TR align="center">";
  7.  
  8.   for($i=0; $i<8; $i++)
  9.   {
  10.     echo "<TD>$result_array[$i]</TD>";
  11.   }
  12.  
  13.   echo "<TD><FORM ACTION="modules.php?name=Job_Log&file=tech_time" METHOD="post">";
  14.   echo "<INPUT TYPE=hidden NAME="job_number" VALUE="$result_array[0]">";
  15.   echo "<INPUT TYPE=submit NAME="submit" VALUE="Tech Time"></TD>";
  16.  
  17.   echo "<TD><FORM ACTION="modules.php?name=Job_Log&file=tech_time" METHOD="post">";
  18.   echo "<INPUT TYPE=hidden NAME="job_number" VALUE="$result_array[0]">";
  19.   echo "<INPUT TYPE=submit NAME="submit" VALUE="Billing Info"></TD>";
  20.  
  21.   echo "</TR>";
  22. }


TIA,
mike

Reply With Quote
  #2  
Old December 16th, 2004, 12:21 AM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: I think I need some javascript?

you never state exactly what you are trying to accomplish...

Reply With Quote
  #3  
Old December 16th, 2004, 12:36 AM
mearnh mearnh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 30 mearnh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: I think I need some javascript?

guess that might help.

I want to be able to click on the button (or link) and pass a variable ($result_array[0]) to a seperate php page and select some info from mysql using that paramater in the sql page?

does that help?


visual image:
TABLE FOOBAR
----------------------------------------
| 123 | blah | blah | blah | (button1) |
| 456 | blah | blah | blah | (button2) |
| 789 | blah | blah | blah | (button3) |
----------------------------------------

click on button 1, go to page xyz.php - "select * from FOOBAR2 where rec_id = 123"
click on button 2, go to page xyz.php - "select * from FOOBAR2 where rec_id = 456"
click on button 3, go to page xyz.php - "select * from FOOBAR2 where rec_id = 789"

currently what happens is regardless of which button I select value 789 is passed....I want the button to cordinate for the record that it represents.

I have seen this done before (I think, creating buttons in a table) but it required javascript and I can't seem to find it or search for it using the correct combination of terms.....

Reply With Quote
  #4  
Old December 16th, 2004, 04:12 AM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: I think I need some javascript?

in each row you have a form opening tag, but not a form closing tag which is causing your problem. as an example, change this bit of code as follows...
php Code:
Original - php Code
  1.  
  2. echo "<TD><FORM ACTION="modules.php?name=Job_Log&file=tech_time" METHOD="post">";
  3.   echo "<INPUT TYPE=hidden NAME="job_number" VALUE="$result_array[0]">";
  4.   echo "<INPUT TYPE=submit NAME="submit" VALUE="Tech Time"></FORM></TD>";


note the closing form tag before the closing </td> tag. Then when the form is submitted it will only post the form fields inside the form tags...

Reply With Quote
  #5  
Old December 16th, 2004, 08:05 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: I think I need some javascript?

what a goob....

That got it.
I just totally over looked that....

thanks,
mike

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > I think I need some javascript?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway