Several checkboxes in a form into multiple lines

Here's the problem I have. I have a table with a list of products and orders. I need to match products to orders in an orginizational page.

I created a repeat region and a set of product images which uses images of products and id to create a list. This part works just fine and it is part of the submission form. The code looks like this:

<? PHP {? >}

< li > <? PHP echo "" < img src = "... / images /', $row_imageListRS ["imageName"] ', '" width = "172" height = "120" > < br / > "

', $row_imageListRS ["altDescription"];? >

< input type = "checkbox" name = 'imgID' value = "<?" PHP echo $row_imageListRS ['id']? ">" / > < br / >

<? PHP echo $row_imageListRS ['id'];? > < /li >

< input type = "hidden" name = "userID" value = "<?" PHP echo $row_currentUserRS ['userID'];? ">" / >

< input type = "hidden" name = "glryID" value = "<?" PHP echo $row_pageRS ['id'];? ">" / >

< input type = "hidden" name = "MM_insert" value = "form1" / >

<? PHP} while ($row_imageListRS = mysql_fetch_assoc ($imageListRS));? >

(that didn't fit in the box formatting)

It gives me a well-formatted list of all products with a checkbox for each image.

Other information is a user ID and an ID of order that also work very well.

I created a function to insert which should work to populate a database table that has only 3 columns other than the primary ID. The columns are, userID, glryID and imgID. I want to be able to review the order and check a bunch of images of the generated list and then click on the submit button and have a new line generated for each image ID.

The problem I have is that the insert loop isn't looped and I get only the first digit of the information. Here's the code for that:

  for ($i = 0, $len = count($_POST['imgID']); $i < $len; $i++) {
  $insertSQL = sprintf("INSERT INTO glryImages (userID, imgID, glryID) VALUES (%s, %s, %s)",
                       GetSQLValueString($_POST['userID'][$i], "int"),
                       GetSQLValueString($_POST['imgID'][$i], "int"),
                       GetSQLValueString($_POST['glryID'][$i], "int"));


  mysql_select_db($database_mbtseaDB, $mbtseaDB);
  $Result1 = mysql_query($insertSQL, $mbtseaDB) or die(mysql_error());

I can't understand why I get only one entry per shipment, and I can't understand why I get only the first digit.

For example, if the user ID is 93 and the ID of the image is 42 and the page id is 12 on line of the resulting table is userID 9 imgID 4 and glryID 1.

I'm sure that the error is in the first line of code for the Insert method. Any help would be appreciated.

I thought I would post the solution because it was a simple thing to overlook. After you set the loop of the boxes I called the original again variable in the insert method. Whatever it took, it was change the line in the middle of the insertion section-

GetSQLValueString ($_POST ['imgID'], "int").

at GerSQLValueString ($imgID, "int").

The crazy is that I made the same mistake before a dozen times. Set a value, and then call the definition instead of the value of the whole...

Thanks to all who watched and didn't see the same thing I don't see. H hope this helps someone else.

Tags: Dreamweaver

Similar Questions

  • I used him copy / paste to add several checkboxes on my form, but now in preview mode when I check the first box it automatically checks all the boxes.  How can I stop this from happening?

    I used him copy / paste to add several checkboxes on my form, but now in preview mode when I check the first box it automatically checks all the boxes.  How can I stop this from happening?

    For later use, it happened because your fields have the same field name, and fields with the same name automatically have the same value.

    So all you had to do was so each had a unique name and it would have worked, but using the command create several fields is preferable because it renames the fields for rename you them.

  • Convert a single column into multiple lines

    Hi people,

    I have a task to display a single column into multiple lines (for use in LOV)

    For Ex:

    The column consistes of value such as 98,78,67,68,34,90. -It's a unique column values where none of the values can be ' number that is separated by commas

    Then we must view it as

    98
    78
    67
    68
    34
    90
    -under the number of lines (no lines can be ' do not number).

    Thanks in advance

    Try this...

    SQL> ed
    Wrote file afiedt.buf
    
      1  select regexp_substr('98,78,67,68,34,90', '[^,]+',1,level) Value
      2    from dual
      3*   connect by level <= regexp_count('98,78,67,68,34,90',',') + 1
    SQL> /
    
    VALUE
    -----------------
    98
    78
    67
    68
    34
    90
    
    6 rows selected.
    

    Thank you!

  • Simple question: how to divide the string into multiple lines concatenated?

    Hi people,

    Maybe it's an easy question.

    How to split a string that is concatenated into multiple lines by using the SQL query?

    ENTRY:
    select 'AAA,BBB,CC,DDDD' as data from dual
    Delimiter = ', '.

    Expected results:
    data
    ------------
    AAA
    BBB
    CCC
    DDDD
    I'm looking for something nice to feature "an opposite to «sys_connect_by_path»»

    Thank you
    Tomas
    with t as (select 'aaaa,,bbbb,cccc,dddd,eeee,ffff' as txt from dual)
    -- end of sample data
    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
    from t
    connect by level <= length(regexp_replace(txt,'[^,]*'))+1
    
    REGEXP_SUBSTR(TXT,'[^,]+',1,LE
    ------------------------------
    aaaa
    bbbb
    cccc
    dddd
    eeee
    ffff
    
  • Several checkboxes in a form

    I'm putting a small group of checkboxes in a form here-> www.hollisterairshow.com/helpusplan.php using the spry validation

    The form is for an air show and we ask visitors to the site, what day you're planning to come - Saturday, Sunday or "Saturday and Sunday. They must select a day and can select both. I use MySQL to store the results and have set up a table with multiple columns, those of this issue is called "Saturday" and "Sunday". If the site visitor selects Saturday, then the Saturday column should be 'Saturday' and that if they choose Sunday then Sunday column should "Sunday." When a column is selected not the content must be Null. When I test here is the result:

    The user selects Contents of column 'Saturday' Content of column "Sunday"
    Saturday only'on '.'on '.
    Sunday only"Sunday.""Sunday."
    Saturday and Sunday"Sunday.""Sunday."

    The code is shown below

    < p align = "left" > what days do you visit?

    < span id = "sprycheckbox1" >
    < label >
    < input type = "checkbox" name = "whichdays" id = "whichdays_0" / > Saturday

    < span class = "checkboxRequiredMsg" > please make a selection. </span >
    < / label >

    < input name = "whichdays" type = "checkbox" value = 'Sunday' id = 'whichdays_1' / > Sunday
    </span >

    < /p >

    I don't know what is happening here and would be really grateful for the help.

    Thank you.

    Tony

    You forgot to update the script to explain the new checkbox field names.

  • Split a string of html into multiple lines

    I'm trying to convert a string into several lines using REGEX, can someone tell me if this is achievable using expressions regular oracle

    WITH qry AS)

    SELECT ' < p > < /p > < p > two < /p > < p > 3 < /p > ' Str

    OF THE DOUBLE

    )

    SELECT

    -regexp_replace)

    -regexp_replace)

    regexp_substr (str,

    ' [^ < (/?) p >]. (*', 1, LEVEL)

    (-, '< p >', ")

    (-, "< /p >", ")

    AB

    OF qry

    CONNECTION OF LEVEL < = LENGTH (regexp_replace (str, ' [^ < (/?) p >]. * "")) + 1

    ;

    Output current:

    1 a < /p > < p > two < /p > < p > 3 < /p >

    2 (null)

    3 (null)

    4 (null)

    Expected results:

    1 a

    2 two

    3 three

    user2022369 wrote:

    You are right that I excluded NULL, 8 rows out put to our example looks correct to me

    The result included "two" because its locked up in one of our separators

    '

    I'm not sure of any character that never appear in str

    Thank you

    Something like:

    WITH qry AS)

    SELECT "Hello World

    one

    a header
    a text or
    here goes

    two

    more text here

    three ' str

    OF the double

    )

    SELECT THE LEVEL,

    REGEXP_SUBSTR)

    Str,

    '(())? (.*?) (()|$)',

    1,

    LEVEL,

    'I,

    4

    ) ab

    OF qry

    CONNECT BY LEVEL<>

    Str,

    '(())? (.*?) (()|$)',

    1,

    'I '.

    )

    /

    LEVEL AB
    ---------- --------------------------------------------------
    1 Hello World
    2 a
    3 a header
    a text or
    here goes
    4 two
    5 more text here
    6 three

    6 selected lines.

    SQL >

    SY.

  • Creating a form of multiple lines

    Hey,.

    I am a student of geology and need to create a column for the stratigraphic record. Contacts between the units can be erosion and are drawn with line round zig - zag.

    I drew the outside box of the column and simple traces for contacts.

    Now, I need color units in various colors. (see photo)

    Unbenannt.JPG

    I tried to join paths, create a compound path, and a group of live paint, but whenever I do that, the zig zag effect is removed from the segment.

    Is it possible first to remove the feature of the direct effect of the zig zag path, so it is not changed when you create a compound path?
    Or is there a much simpler method to create these forms?

    Thanks for your time and your help and please excuse my English

    Cheers to the Germany

    Your English is very good. Select the two lines in zigzag and the menu object, choose Expand or break down the appearance (if available). Then take the Brush tool and click on each area you want to be a filling. Then fill with the color/pattern that you need.

  • Where to put the code block that is used by several checkboxes in a form

    I'm new to Javascript, please go easy on me.

    I have a form with several boxes on it.      I have a block of javascript code that I want to run any time one of the check boxes on the form is enabled or disabled.

    I know that I can put javascript code in each box properties, but it seems that there should be an easier way to do it.

    Can I create one subroutine somewhere else and call it from javascript for each text box code?

    If I can create a subroutine and call from each text box, where should I put the subroutine?

    Help, please.      Example (s) would be great.

    Here's a good tutorial on the subject of the JavaScripts at the level of the document: http://acrobatusers.com/tutorials/js_document_scripts

  • Adding field values into multiple lines in a dynamic table

    Hello!

    I have create this form (timesheet) where I have a dynamic array with a variable number of lines (I'm adding instances with a single click of a button).

    All rows with a field of totalLinhaRelatorio , it is a time field and I need all of these fields to be added to get a total final.

    So, I tried these two lines of script (FormCalc):

    var finalTotal = sum (Time2Num (rio parteInferior.atividades.tabelaAtividades.linhaAtividade [*] [*] .totalLinhaRelato, "HH: mm"))

    $.formattedValue = Num2Time (finalTotal, "HH: mm")

    It doesn´t works as I expected. The field gets properly just the value of the first row.

    I tried other combinations, such as linhaAtividade.totalLinhaRelatorio [*] and .totalLinhaRelatorio linhaAtividade [*], but nothing seems to work.

    Help, please!

    Marcos

    You're welcome Marcos!

    Yes, it is possible, but I've never used FormCalc to do, preferring to JavaScript. As you use the time functions, it makes sense to stick with FormCalc.

    Take a look at the syntax here:

    http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000211.html.

    Hope that helps,

    Niall

  • Single field into multiple lines of cutting


    Hi all

    with res in the

    (select 10 as id, 'history of medic' as the title of double union )

    Select 20 as id, 'hospital of oklahoma heart' as the title of double union

    Select 30 as id, ' Date/time end " like double title " )

    Select disitnct

    a.ID, a.title

    res a

    Output of the above code:

    ID TITLE

    10 background medic

    Heart 20 oklahoma hospital

    30 latest End Date/time

    Here's my task, I need an output like below.

    ID TITLE

    10 past

    10 medic

    10 history

    20 oklahoma

    heart 20

    Hospital 20

    30 last

    30 end

    30 date/time

    Thanks in advance.

    A simple search can do wonders for you

    https://community.Oracle.com/search.jspa?q=string+to+row&place=%2Fplaces%2F1265&depth=all&customTheme=OTN

  • Cutting into multiple lines line values

    I have the table with columns like below

    Table name: Test

    Column name: Col1, col2, col3, col4

    Values of column as below

    col1 col2 col3 col4

    A cod mod ss; AA; DD ff; Gg; AAS; feq

    B asd; DFG; as fgh null

    Ouput: I'm looking:

    col1 col2 col3 col4

    A cod ss dd

    A mod gg aa

    A                         ff           aas

    A                                     feq

    B asd fgh

    B dfg

    B             as

    Can someone help me on this?

    But if you insist

    with

    a trial in

    (select 'A' col1, col2 "cod;) MOD','ss; AA; FF' col3, col4 'dd, gg, ASA, feq' Union double all the

    Select ' B', ' ASD. DFG; ACEs ', 'Natacha', the double null

    )

    Select col1,

    NULLIF (regexp_substr (NVL(col2,'~'), "[^;]")) +', 1, level),'~ ') col2.

    NULLIF (regexp_substr (NVL(col3,'~'), "[^;]")) +', 1, level),'~ ') col3.

    NULLIF (regexp_substr (NVL(COL4,'~'), "[^;]")) +', 1, level),'~ ') col4

    of the test

    connect by level<= greatest(regexp_count(nvl(col2,'~'),';'),regexp_count(nvl(col3,'~'),';'),regexp_count(nvl(col4,'~'),';'))="" +="">

    and prior col1 = col1

    and prior sys_guid() is not null

    COL1 COL2 COL3 COL4
    A COD SS DD
    A MOD AA GG
    A - FF AAS
    A - - FEQ
    B ASD FGH -
    B DFG - -
    B as - -

    Concerning

    Etbin

  • I have a pdf form that has 4 columns, with each column having 28 check boxes and text between. I did so he goes by column, but when I do anything for a checkbox it takes it out of line. How can I keep that from happening?

    I have a pdf form that has 4 columns, with each column having 28 check boxes and text between. I did so he goes by column, but when I do anything for a checkbox it takes it out of line. How can I keep that from happening?

    You talk about the tab order? If Yes, go to Edit - Preferences - forms and make sure the box "Automatically adjust tab order when changing fields" is NOT checked.

  • Combine multiple lines into one line (from two tables / result sets)

    Hello experts,

    I would like to know how to combine multiple lines/records in a single record. Here are the DDL and DML to tables:

    create table test_table)

    client_name varchar2 (50 char),

    login_time timestamp (6).

    logout_time timestamp (6).

    auto_type varchar2 (10 char)

    )

    create table root_table)

    navigation_time timestamp (6).

    client_name varchar2 (50 char),

    VARCHAR2 (50 char) nom_du_groupe

    )

    Insert into test_table

    values ("John", TO_TIMESTAMP ('2013-12-05 17:04:01.512 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), TO_TIMESTAMP ('2013-12-05 17:27:31.308 ',' YYYY-MM-DD HH24:MI:SS.) FF'), 'SIMPLE');

    Insert into test_table

    values ('David', TO_TIMESTAMP ('2013-12-05 06:33:01.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), TO_TIMESTAMP ('2013-12-05 06:45:01.112 ',' YYYY-MM-DD HH24:MI:SS.) FF'), 'SIMPLE');

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 17:04:01.512 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "invalid");

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 17:14:22.333 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "GROUP_1");

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 17:27:31.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "GROUP_1");

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 06:33:01.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), "David", "invalid");

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 06:45:01.112 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'David', 'GROUP_5');

    game results test_table

    client_name

    login_time logout_time auto_typeJohn05/12/2013 5:04:01.512000 PM05/12/2013 5:27:31.308000 PMSIMPLEDavid05/12/2013 6:33:01.308000 AM05/12/2013 6:45:01.112000 AMSIMPLE

    root_table result set

    navigation_time client_name GroupName
    05/12/2013 5:04:01.512000 PMJohnNot valid
    05/12/2013 5:14:22.333000 PMJohnGROUP_1
    05/12/2013 5:27:31.308000 PMJohnGROUP_1
    05/12/2013 6:33:01.308000 AMDavidNot valid
    05/12/2013 6:45:01.112000 AMDavidGROUP_5

    And here is the SQL code I'm writing:

    Select a.customer_name, a.login_time, a.logout_time, a.auto_type, Max (b.group_name)

    from test_table a, b root_table

    where a.customer_name = b.customer_name

    Group of a.customer_name, a.login_time, a.logout_time, a.auto_type

    As the 'invalid' value is greater than the value "GROUP_1" (based on the number of letter in English), the GroupName is returned as 'invalid '. I want to bring the GroupName based on the navigation_time column in the root_table so that it always returns a valid GroupName. Please help me.

    Output current:

    Client_name.      Login_Time.     Logout_Time |     Auto_Type |     GroupName

    --------------------------------------------------------------------------------------------------------------------------------------------

    John |     05/12/2013 5:04:01.512000 PM |     05/12/2013 5:27:31.308000 PM |     SIMPLE |     Not valid

    David |     05/12/2013 6:33:01.308000 AM |     05/12/2013 6:45:01.112000 AM |     SIMPLE |     Not valid

    Expected results:

    Client_name.      Login_Time.     Logout_Time |     Auto_Type |     GroupName

    --------------------------------------------------------------------------------------------------------------------------------------------

    John |     05/12/2013 5:04:01.512000 PM |     05/12/2013 5:27:31.308000 PM |     SIMPLE |     GROUP_1

    David |     05/12/2013 6:33:01.308000 AM |     05/12/2013 6:45:01.112000 AM |     SIMPLE |     GROUP_5

    Thank you!

    Adding INSERT statements, current and planned outputs.

    This...

    SELECT client_name

    login_time,

    logout_time,

    auto_type,

    GroupName

    Of

    (select a.customer_name,

    a.login_time,

    a.logout_time,

    a.auto_type,

    b.group_name,

    ROW_NUMBER() over (PARTITION BY a.customer_name, a.login_time, a.logout_time, a.auto_type ORDER BY b.group_name) rn

    from test_table a, b root_table

    where a.customer_name = b.customer_name)

    WHERE rn = 1;

    OUTPUT:-

    =========

    David DECEMBER 5, 13 06.33.01.308000000 AM DECEMBER 5, 13 06.45.01.112000000 AM SIMPLE GROUP_5
    John DECEMBER 5, 13 05.04.01.512000000 PM DECEMBER 5, 13 05.27.31.308000000 PM SIMPLE GROUP_1

    Thank you

    Ann

  • Data in multiple lines concatenated into a single line to separate id

    Hello

    I have a t1 like this table:

    create table t1
    (number of c1,
    number of C2,
    C3 number (4.2)
    );

    Data in the table are such as:

    ----------------------------------------
    C1 | C2 | C3 |
    -----------------------------------------
    102. 1. 1.1 |
    102. 1. 1.2 |
    102. 2. 2.1 |
    103. 2. 2.1 |
    103. 2. 2.2 |
    -----------------------------------------

    How to display data by using a query above?

    ------------------------------------------------------
    C1 | C2 | C3 |
    -------------------------------------------------------
    102. 1, 2 | 1.1, 1.2, 2.1 |
    103. 2. 2.1, 2.2.
    ------------------------------------------------------

    Thank you

    So you're after what we call 'Aggregation in the chain.'

    Check this link as it highlights several techniques:

    Aggregation of string techniques

    A Re: Concat ranks of the values in a single column Michael

    At Re: multiple lines in a single line in the 'single column Table' followed by reason of Billy on the conduct of a stragg first.

    In addition, 11 GR 2 has the LISTAGG function.

  • Divide a document into multiple records (lines)

    I use ODI to move the data from the source on the target system. Both are Oracle. In the source system, I have a file I need to split into multiple records or lines in the system target according to certain rules. How can I achieve this in ODI. Please explain

    Hello

    What a day I understood your example

    I have a few questions...

    1. you have information about the patient in a table 1 source.
    2. How do you identify for patient X you need to create 5 rows. you store this information in the table seprate or how...

    3. If you have this information in separate tables... a simple cross join in ODI, you should get the result...

    Or give additional information with an example... it would be great...

    Thank you

Maybe you are looking for