Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3946052
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:05:15+00:00 2026-05-20T01:05:15+00:00

I am working on a web application written in delphi and am having trouble

  • 0

I am working on a web application written in delphi and am having trouble getting the values from an array of values. The form looks similar to this:

<form method="post">
  <input type="hidden" name="keyword[]" value="1"/>
  <input type="hidden" name="keyword[]" value="2"/>
  <input type="hidden" name="keyword[]" value="3"/>
  <input type="submit" value="submit"/>
</form>

If this were a single input with a unique name, I could pull the data using this:

var cKeyword : String ;
cKeyword := Request.ContentFields.Values['keyword'] ;

I’m looking for something like this:

var aKeywords : Array of String ;
aKeywords := Request.ContentFields.Values['keyword[]'] ;

In PHP you could just use $aKeywords = $_POST['keyword'], I’m hoping there’s a way to do this in delphi.

Thanks in advance for any help you can provide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:05:16+00:00Added an answer on May 20, 2026 at 1:05 am

    The ContentFields property is just an ordinary TStrings object, so its Values property always returns a string. When an HTML form has multiple successful controls with the same name, they’re simply all returned, one after the next. That means the TStrings object will have multiple entries with the same Names value. You’ll need to iterate over all the entries to find the ones with matching names.

    Here’s a function that might help.

    function GetArrayFieldValues(ContentFields: TStrings; const FieldName: string): TStringDynArray;
    var
      i: Integer;
      Values: TStrings;
    begin
      Values := TStringList.Create;
      try
        for i := 0 to Pred(ContentFields.Count) do
          if ContentFields.Names[i] = FieldName then
            Values.Add(ContentFields.ValueFromIndex(i));
        Result := Values.ToStringArray;
      finally
        Values.Free;
      end;
    end;
    

    Call it like this:

    aKeywords := GetArrayFieldValues(Request.ContentFields, 'keyword[]');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a web application, where I transfer data from the server
I am working on a web application in Java which gets data from servlets
I am working on a legacy web application written in VB.NET for ASP.NET 1.1.
I'm working on deploying a web application written in C# with ASP.Net Application services
I'm working on a web application written in Java using the Tapestry 5.1.0.5 framework.
I am working on a web application using Python (Django) and would like to
I am working on a web application (J2EE) and I would like to know
I am working on a web-application in which dynamically-created images are used to display
I'm working in a web application using VB.NET. There is also VisualBasic code mixed
I am working on a web application and I have run into the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.