The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Jun 17, 2012 7:43 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri May 18, 2012 2:22 pm
Posts: 7
Hello all,

I'm trying to create some custom code and I'm having trouble using the Joomla API.

This particular problem is with JRequest::getVar(). I have several textfields with the name 'tenant'.
I assume I could tell the method to get an array and receive all values for tenant as an array. However,
I'm only getting the last value. Very suspicious. Here's my code. I just installed Joomla 1.5 on WAMP.

count( JRequest::getVar('tenant', array(), 'post', 'array') ) returns 1.

Any suggestions?


Top
 Profile  
 
PostPosted: Sun Jun 17, 2012 11:08 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Thu Feb 15, 2007 5:48 am
Posts: 3344
Location: Sydney, Australia
Each input field name has to be different, and 'tenant' has to be the name of the array, not the name of any field. Here is an example from the Joomla registration where the name of the array is 'jform':
Code:
<input type="text" name="jform[username]" id="jform_username" value="" class="validate-username required" size="30"/>
<input type="password" name="jform[password1]" id="jform_password1" value="" autocomplete="off" class="validate-password required" size="30"/>

_________________
toivo
my first programs were assembled and run in 16KB :)
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 



Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group