SunQuest
           HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

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 Dev Shed Forums Sponsor:
  #1  
Old July 7th, 2000, 04:36 AM
micky micky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 5 micky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ok. I have been able to build a screen which populates 2 select objects from the database and allows the user to tranfer items from one select list to the other. Is there a way to convert the dynamically populated arrays to input objects so that they can be posted intact to the cgi?

Reply With Quote
  #2  
Old July 18th, 2000, 02:43 PM
micky micky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 5 micky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
OK, I put this problem aside for awhile and came back to it today. It may be useful to some of you that are working with Javascript and PHP, so I'll let you know what I came up with.

PHP allows form variables with the same name ending in empty square brackets to be sent to php as an array (e.g. <input type=select name = "mylist[]"> ) This is just plain handy.

Recently I was using javascript to move items between two lists and wanted to send the content of one of the lists (very similar to a shopping cart) to my script as an array. My scripts kept failing if I named my item 'list2[]' because javascript thinks list2[] is an object which should have properties.

In my case, the action was all within the same form, so I was able to get around this by referring to the select lists as this.form['list2[]'] when I needed to past the select list as an argument to javascript.


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > post an array to cgi?


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