Jump to content

Search the Community

Showing results for tags 'array issues'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi we are working some php code and we have created the drop down box but it is creating an array. We are trying to rewrite a piece of code that was originially written for select boxes but with 50 options that a bit too many select boxes and a drop down box is a lot cleaner. The dropdown box is created but the word "array" appears in the box and there are no options to choose from. Here is the code we are trying to get working. case 'multiselectbox': case 'selectbox': echo '<div class="editfield field_'.$field_id.' selectbox">'; $tt = array(); if($get_field) { $tt = $get_field; } foreach ($children as $child) { $child->name = trim ($child->name); $child = (in_array ($child->name, $tt ); echo '<input type="dropdown" name="'. $fieldName . '_' . $field_id . '" value="'. $children. '" style="width:20%" placeholder="Category" />'; echo '</div>'; break; Here is the code as it was originially written with the select boxes. case 'radio': case 'checkbox': echo '<div class="editfield field_'.$field_id.' checkbox">'; echo '<span class="label">' . $field_data->name. '</span>'; $tt = array(); if($get_field) { $tt = $get_field; } //echo '<div class="wppl-checkboxes-wrapper">'; foreach ($children as $child) { $child->name = trim ($child->name); $checked = (in_array ($child->name, $tt ) )? "checked='checked'": ""; echo '<label><input ' .$checked . ' type="checkbox" name="'. $fieldName . '_' . $field_id. '[]" value="'.$child->name.'" />'.$child->name.'</label>'; } //echo '</div>'; echo '</div>'; break; } // switch } echo '</div>'; } Can you please help us? Thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.