Designer? Programmer? Enthusiast? Join Open Designs Now!

Open Designs Forum » Designer Talk

Preserving Empty Fields

(7 posts)

No tags yet.

  1. summitr
    Member

    Is there any way to preserve empty fields in an input array when passing it to php?

    I have 3 input arrays: item, list, and sale. The sale doesn't always have a value. The way I'm getting around it right now is entering in a '%' and parsing that to keep it empty. Is there a way to leave it blank and still keep formatting?

    Posted 11 months ago #
  2. bakercad
    Moderator

    not really sure what you're trying to do. Can you explain a little more clearly?

    Posted 11 months ago #
  3. bakercad
    Moderator

    when you say "input arrays", are you talking about the $_POST array that is passed to php? And the three array "keys" are item, list, and sale? If sale is blank, what is the "formatting" of which you speak?

    Posted 11 months ago #
  4. Gnome
    Moderator

    Bob: I think that he has three arrays, all of which should be the same length. If one element of sale has nothing in it, the array may collapse that element, messing up the alignment of the three arrays.

    The best solution I can think of is to use a matrix instead, so that asscoiated values remain in sync.

    Posted 11 months ago #
  5. summitr
    Member

    That is what I was talking about Gnome. I found a solution for now. I'm just using javascript to check the sale fields on blur. If they are empty I'm adding my wildcard character. That way it is added even if people forget.

    When you say use a matrix, how would that be setup? Could you give me a quick example of the html and the php to access it? I did some searching but couldn't find an example.

    Posted 11 months ago #
  6. uberlemurguy
    Moderator

    if you can give an actually demo of the fields that would be really useful.

    -- Alec
    OpenCSS.net

    Posted 11 months ago #
  7. Gnome
    Moderator

    A matrix is simply a two-dimensional array. each row of the matrix would represent one of your variables.

    http://ca3.php.net/manual/en/language.types.array.php

    Posted 11 months ago #

RSS feed for this topic

Reply

You must log in to post.