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:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old December 9th, 2003, 11:39 PM
supermanesh supermanesh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 supermanesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Selecting a row in a table

Hi, I have a html table which has several rows. On each row there is a button to remove that entry. However I am having trouble referenceing the row and/or passing that row to the post array

Any help would be great, Thanks in advance

Reply With Quote
  #2  
Old December 10th, 2003, 12:35 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: Selecting a row in a table

You would need to make sure that each row is it's own form that contains a hidden input element that has a value that equates to some kind of id for the row that needs to be deleted. Post some code based on what you already have and I will see if I can help.

Reply With Quote
  #3  
Old December 10th, 2003, 12:43 AM
supermanesh supermanesh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 supermanesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Selecting a row in a table

Hi sorry the code is messy! I use a for loop to get all the values from some arrays, the number of elements in the arrays, being the number of rows.

php Code:
Original - php Code
  1.  
  2.         print("<tr>");
  3.         print("    <td width="14%" valign="middle" align="center" height="1" nowrap>".$code."</td>");
  4.         print("    <td width="62%" valign="middle" align="center" height="1" nowrap>".$name."</td>");
  5.         print("    <td width="13%" valign="middle" align="center" height="1" nowrap>".$price."</td>");
  6.         print("    <td width="11%" valign="middle" align="center" height="1" nowrap>");
  7.         print("      <form method="POST" action="cart.php">");
  8.         print("        <p style="word-spacing: 0; line-height: 100%; margin-top: 0; margin-bottom: 0">");
  9.         print("        <input type="submit" value="Remove" name="remove"></p>");
  10.         print("      </form>");
  11.         print("    </td>");
  12.         print("  </tr>");


Thanks in advance

Reply With Quote
  #4  
Old December 10th, 2003, 01:01 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: Selecting a row in a table

you pretty much have what you need, you just need some identifier for the cart Item. If $code is a unique identifier for the item, put that value into a hidden input element within the form. once posted, you will have that code to use for any deletion you need to do. Hope that makes sense!!

Reply With Quote
  #5  
Old December 10th, 2003, 01:14 AM
supermanesh supermanesh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 supermanesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Selecting a row in a table

Do you know how to do the 'hidden input' and will this input be passed as a post value?

Reply With Quote
  #6  
Old December 10th, 2003, 12:03 PM
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: Selecting a row in a table

here is an example of a hidden input form element...

<input type="hidden" name="ID" value="5" >

and yes, it is passed as a post value. It is passed just like a textbox input element but it is just not visible in the browser.

Reply With Quote
  #7  
Old December 10th, 2003, 01:44 PM
supermanesh supermanesh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 supermanesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Selecting a row in a table

Thanks that works fine
My basket is complete!!!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Selecting a row in a table


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 5 hosted by Hostway