PHP/HTML: Returning input from a text box in a sub-array of the $_POST array?

I have a page for entering/editing the data for a table of
contacts, and would like to be
able to compare the data for two different entries.
Conceptually the simplest way to do
this would be to load two identical copies of the same page,
and have each copy return its
results in a separate sub array in the $_POST array.
For example I have an input which returns a value
$_POST['address']. Is there any simple
way whereby I could instruct this input to return
$_POST['entry_1']['address'] in the
first copy, and $_POST['entry_2']['address'] in the second
copy?
A similar question relates to fields which have sub entries.
At present I encode these
into the name of the return value (for example 'al1' in the
case below), and have to
decode them before I can put the results into the right box,
but it would make things much
simpler -- and therefore easier to understand and less error
prone -- if I could return
$_POST['address']['line_1'] and so on directly.

On Sat, 21 Feb 2009 12:57:27 +0000 (UTC), Joe Makowiec
<[email protected]> wrote:
>On 20 Feb 2009 in macromedia.dreamweaver, Clancy wrote:
>
>> I have a page for entering/editing the data for a
table of contacts,
>> and would like to be able to compare the data for
two different
>> entries. Conceptually the simplest way to do this
would be to load
>> two identical copies of the same page, and have each
copy return its
>> results in a separate sub array in the $_POST array.
>>
>> For example I have an input which returns a value
$_POST['address'].
>> Is there any simple way whereby I could instruct
this input to
>> return $_POST['entry_1']['address'] in the first
copy, and
>> $_POST['entry_2']['address'] in the second copy?
>>
>> A similar question relates to fields which have sub
entries. At
>> present I encode these into the name of the return
value (for
>> example 'al1' in the case below), and have to decode
them before I
>> can put the results into the right box, but it would
make things
>> much simpler -- and therefore easier to understand
and less error
>> prone -- if I could return
$_POST['address']['line_1'] and so on
>> directly.
>
>You can sort of do this by adding square brackets [] to
the name
>attribute of several identically-named input fields:
>
><form name="form1" method="post" action="<?php echo
$_SERVER['PHP_SELF']; ?>">
> <p><label
for="streetAddress">Street</label>
> <input type="text" name="address[]"
id="streetAddress"></p>
> <p><label
for="apartment">Apartment</label>
> <input type="text" name="address[]"
id="apartment"></p>
> <p><input type="submit" name="button"
id="button" value="Submit"></p>
></form>
><?php
>if ($_SERVER['REQUEST_METHOD'] == 'POST') {
> echo "<p>Post array:</p>\n";
> echo "<pre>\n";
> print_r($_POST);
> echo "</pre>\n";
>}
>?>
>
>What gets returned is $_POST['address'][], where the
second index
>ranges between 0 and the number of same-named input
fields less 1.
>In the code above, 'apartment' would be addressed as
>$_POST['address'][1].
Thanks, Joe,
This is interesting, but not really what I was looking for.
It might be helpful for
entering the results from one page, but it doesn't really
help in separating the outputs
from two copies of the same page. I suppose, though, I could
count the number of (say)
'address' responses, and divide by the number of identical
pages. Then I would know at
terms 0 to 3 belong to the first page, and 4 to 7 to the
second -- provided I always had
the same number of items on each copy of the page, which
ain't necessarily so!
However I doubt whether this is any simpler than the
alternative of encoding the page
number into the name of the variable.

Similar Messages

  • 0 down vote favorite share [fb] share [tw]        How to hide cut/copy/paste/Replace- menu on the UIWebView when it is being displayed over the keyboard.  Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text b

    How to hide cut/copy/paste/Replace… menu on the UIWebView when it is being displayed over the keyboard.
    Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text box it shows the keyboard. Now If user tap and hold on text box it shows a popup menu. Now while keyboard and pop up are being displayed user scrolls the view. At this time it shows pop up over the keyboard which I need to hide.
    I tried setMenuVisible of UIMenuController when popup rect and keyboard rect intersects each other on viewDidScroll but it didn't help me.
    Any clues will help a lot.
    Thanks.

    You are more likely to get an answer if you post programming problems to the Developer forum. This forum is intended for normal user level problems.

  • Exporting Text from multiple text boxes?

    I'm using InDesign CS3 on the Macintosh. I need to export text from multiple text boxes/stories into one text file. The Export File command only exports text when the text tool is selected and the cursor is in the text box. Unfortunately, I have 8-20 individual text boxes per page, none are linked, and my document is 100+ pages, so selecting each text box individually is much too time consuming. There must be a better way - Please help!
    Thanks!
    Carolyn

    The text exporter plug-in seems to work! I did a quick test - text still will need some clean-up to make sure it's in the correct order, but MUCH better than exporting each story individually. THANKS!

  • How can I make the Counter move from inside text box to inside Footer?

    I am tweaking a page. At this point, I cannot move the Counter and the Email Me icon from the bottom of the text box to inside the footer like someone here said he does.
    Why do the Counter and the Email Me icon resist being moved?
    I am in Graphics mode. I never had this problem before.
    — Lorna in Southern California

    Lorna,
    I'm not sure why you can't move it down into the
    footer — by inside the text box, do you mean the page
    "content" or "body" section, or did you somehow get
    the icons into a text box? I know that you can
    "force" a text box into the footer (or header) by
    selecting it, then dragging it while holding the
    command (Apple) key down at the same time.
    Hope this helps.
    Bob
    Bob,
    When I say Text box maybe I am not using the right word. I am referring to that entire space on the page which is dedicated to receiving documents or images. If you have a lot of pictures or words, then that text box/space has to be lengthened to accomodate.
    I am saying that the two icons -- Counter and Email Me -- are sitting (or were sitting. It's morning now and honestly, I can't recall from last night!) at the very bottom of the text box/space.
    I made a Footer (55 pixels) specially to accomodate the Counter and Email icons. The problem, as stated, was/is that those icons would not budge from where they were sitting.
    — Lorna in Southern California

  • How can i release text from a text box?

    How can I release text from a text box? I want the shape of the text box without the text in it.

    So all you need is to make a line around the text?
    For this you don't need to release the text box from the text. Just apply a stroke to it.

  • Issue with 'text box' in rtf sub template for peoplesoft XMLP

    Hi all,
    i have a weired problem using 'text Box' in a sub template. I am calling a sub template from my template. In my Sub template i have a text box ( i am using text box bcoz i want to justify the text not to the page margin but starting from a specific column.not sure if there is any other way with which i can do the same !!) . When i process the report (using application engine program) i get the below error
    Message Log entry:
    [052311_071441208][oracle.apps.xdo.common.xml.XSLTWrapper][ERROR] XSL error:
    psxmlp://SUB_BMX2<Line 63, Column 191>: XML-22031: (Error) Variable not defined: '_MR'.
    @Line 63 ==> </xsl:stylesheet>
    [052311_071441216][oracle.apps.xdo.template.FOProcessor][EXCEPTION] java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:618)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at com.peoplesoft.pt.xmlpublisher.PTFOProcessor.generateOutput(PTFOProcessor.java:74)
    Caused by: oracle.xdo.parser.v2.XPathException: Variable not defined: '_MR'.
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1534)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:521)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
         ... 13 more
    [052311_071441218][oracle.apps.xdo.template.FOProcessor][ERROR] End Memory: max=64MB, total=11MB, free=1MB
    PeopleTools 8.49.27 - Application Engine
    Copyright (c) 1988-2011 PeopleSoft, Inc.
    All Rights Reserved
    Processing started
    data extraction for EMPLID:1000646332 EMPL_RCD:0 EFFDT:2009-12-28 and EFFSEQ:6
    CFilem::LoadDefn(RDCRHIUTEECKNDZN2SPSRQ) : read 1 chunks
    UnchunkStuff : read 1 chunks for nCharDataLen 10520 chars
    CFilem::LoadDefn(RDCRHIUTEECKNDZN2SPSRQ) : after decode & decompress: 35330 bytes
    Calling XMLP
    Processing Report Defn:TR_BMX2
    Error Executing XMLP.Error generating report output: (235,2309) PSXP_RPTDEFNMANAGER.ReportDefn.OnExecute Name:ProcessReport PCPC:51952 Statement:1163
    Called from:TR_LATAM_CONTRACTS.ContractsXML.OnExecute Name:ExecuteXmlp Statement:16
    Called from:TR_LAMCNTRCT.MAIN.GBL.default.1900-01-01.Step04.OnExecute Statement:20
    Process 442706 ABENDED at Step TR_LAMCNTRCT.MAIN.Step04 (PeopleCode) -- RC = 22 (108,524)
    Process %s ABENDED at Step %s.%s.%s (Action %s) -- RC = %s
    It works fine when i remove the text box from my sub template. I tried to put the text box directly in the main template and it worked fine !! it is erroring out only when i use the text box in sub template !!
    Template file:
    <?import:psxmlp://SUB_BMX2?>
    <?choose:?>
    <?when: .//LETTER_CD=”PA4”?>
    <?call: BA101?>
    <?end when?>
    <?otherwise:?>
    Invalid Letter Code. No Sub Template Call defined for this Letter Code.
    <?end otherwise?>
    <?end choose?>
    Sub Template:
    <?template:BA101?>
    Testing without text box.
    Testing with text box
    there is a text box with text here .. cannot be copied from word !!
    <?end template?>
    i got the below error when i tried to 'preview' the report from my report definition.
    Error generating the report output: During calling method PTFOProcessor.generateOutput, the XDO engine throws an exception:NULL. (235,3101) (235,2309)
    Error occurred during the process of generating the output file from template file, XML file, and the translation XLIFF file.
    Any help would be greatly appreciated.
    Edited by: Naveen Kumar on May 23, 2011 4:31 AM

    misunderstood =/
    Original (Coming - output):  "<PAY_TXT>PAYκ Contact your bank or financial institution to make this payment from your cheque, savings, debit or transaction account.</PAY_TXT>"
    it's in output but what is data in database ?
    sorry but without knowing about source data for forming the xml i haven't ideas about your problem
    in db it's "TM " or "™" or ... ?
    Original (Coming - output):  "<PAY_TXT>PAYκ Contact your bank or financial institution to make this payment from your cheque, savings, debit or transaction account.</PAY_TXT>"
    Something like XAE or "K" after PAY Value in the xml tag and continued the text value.  (Tag value is not getting copied exactly here - i am sorry for that )
    that's ok. i need to see the problem not the data as is
    Expected (output):  "Here it needs to produce the "PAY TM" (Here "TM" should be super scripted to "PAY" Value in tag).
    as super scripted in xml?
    as idea - you can have <PAY_TXT>PAY TM</PAY_TXT> and in publisher set TM as super
    Designing XSL Subtemplates - 11g Release 1 (11.1.1)

  • How to email text from a text component in my applet on a the host server ?

    How to email text from a text component in my applet on a the host server, back to my email address ?
    Assuming I have Email Form on the host server.
    Help will be appreciated.

    You can do like below
    =REPLACE(Fields!Column.Value," " & Parameters!ParameterName.value & " ","<b>" & Parameters!ParameterName.value & "</b>")
    The select the expression and  right click and choose placeholder properties
    Inside that set Markup type as HTML 
    then it will highlight the passed parameter value in bold within the full xml string
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • When using the "Fill & Sign PDF" feature, is there a way to stretch to size the text box, for a specific area on the page...instead of it going on in one straight long line...?

    When using the "Fill & Sign PDF" feature, is there a way to stretch to size the text box on a specific area of the page...instead of the text box going on in one straight long line....? I'm not seeing there's an option or ability to do so, just wanting to confirm.

    Improving the handling of multiple line text fields is in our plans, but for now, you will have to add manual carriage returns (Enter).
    Thanks,
    Josh

  • How to link a text box to an anchor frame in the master pages?

    Ok, as the title states, we are trying to figure out if it is possible to link a text box to an anchor frame in the master page. When you look at our Master Page layout, we have a text box in the upper left hand corner of the left hand page, this is used for our machine serial numbers. Then we have an anchor frame that automatically fills out the figure number. Let's say I have pages 2 & 3 (left & right), they have a S/N at the top of the page for the machine, then pages 4 & 5 have a different S/N. If I have to add more pages in between pages 2 & 3 (bumping the current 4 & 5 to 6 & 7), the anchor frame bumps to the next page, but the S/N text box doesn't. Is there a way to fix it so that they both move to the next page? Thanks for the help.
    P.S. I can include images and other info if needed.

    I have included a two pictures that should help me explain.
    Master Page:
    This is the master page set up, the "Page Text Box" has the flow set to "B" while the S/N text box has the flow set to "A". This setup is for our parts manuals, the left page is usually an illustration while the right page is usually a parts list. The text box, anchored frame & paragraph tag are empty in the master page set up. The "page text box" has a flow of "B" and the "S/N text box" has a master flow of "A".
    Body Page 1:
    When we create new pages, the paragraph tag automatically fills in the figure title on the left page, then we add an anchor frame within the text box to hold the illustration. You will notice that I added in a "test" serial number at the top of the page. Now if I need to go back and add two pages before this, the anchor frame, illustration and parts list will move to a new page, but the S/N text box will not. The "Before S/N TBD" would stay on the original page.
    This is what happens, the text box containing the illustration and the parts list "bump" to the next page, but the S/N text box does not. So the question we have is there a way to link that text box to the page so when we create new pages the S/N text box moves with the illustration.
    Does this help?
    Thanks for the assistance Error7103.

  • After placing a new text box in my document, typing new text, clicking away, then coming back to edit the text, I am unable to get my cursor to reappear within that text box. I can only select the box itself. I cannot select the text. Where is my cursor?

    After placing a new text box in my document, typing new text, clicking away, then coming back to edit the text, I am unable to get my cursor to reappear within that text box. I can only select the box itself. I cannot select the text. Where is my cursor?

    Even simpler than that.
    Clicking once in a text box selects it.
    Clicking once in a selected text box places the insertion point in the box.
    The clicks do not need to be close enough in time to be read as a double click.
    The same behaviour applies to table cells in Pages and in Numbers.
    Regards,
    Barry

  • Text has different look from one text box to the next on same page issue

    Hi,
    I'm in the process of creating a new site that contains quite a bit of text from a book I wrote. I've taken the text from the original source, put it into text editor and made it into plain text. From there, I've pasted it into the iWeb text boxes and adjusted the text look (font is Arial, justified alignment). When viewing it in IE (probably others?), one block of text looks different than others.
    http://www.goaheadtakethewheel.com/Test13.html
    I've verified that the font size and other options are all the same on iWeb. For the life of me I can't seem to figure this out. The only way I can think of possibly resolving this is to re-type each section from scratch. Given that there are about 75 wordy pages...UGGGG!
    Any suggestions or ideas? Thanks for your time and help!!
    Dave Gran

    You could first try deleting your iweb preference file <com.apple.iWeb.plist> it is in your Library/preference folder.
    To create a new domain file, first save your current file in a safe place, such as an external hard drive, burn to a CD, etc. By default it is in your User/Library/Application Support/iWeb folder. All your work is in this file, keep it safely backed up, if you lose this file you lose all your work, you can't restore from the published web site. When you get this file saved safely off your computer and open iWeb it will create a new empty domain. Once you have the new file created you can bring the old file back to the computer. You can put them side by side in any folder (give them different names so one won't replace the other) At this point you can double click the domain file itself to open iWeb. You could try cut and paste between the two domains. I'm not sure this will solve the problem but you could try it on one page, publish to a local folder and see if it helps. Sounds like a lot of work.
    Which ever domain file was last used is the one iWeb will subsequently open unless you double click the actual domain file to open iWeb. Be careful and good luck.
    David

  • How to build an array based on inputs from a text file

    Hi
    I have ta text file that has the following format. The apmlitude is the first value then I have the start index number and last index number
    Other index values in between should be zero
    (amplitide, start index number, end index number)
    2, 2 ,3
    4, 6, 7
    5, 10,11
    using this format I should make the foloowing array
    0,0,2,2,0,0,4,4,0,0,5,5
    Could you please help me to implement it in LabVIEW
    Thanks

    A few notes:
    - You'll want to use the Initialize Array function for 1) and 3) (if this is, in fact, how you want to do this.)  This function takes two inputs when initializing a 1D array- element value and array size.   
    - Change the polymorphic instance of Read From Spreadsheet File.vi to "Double" or "Integer"- there's no reason to read in these numeric values as strings and convert them later.
    - Will the text file always contain 12 elements worth of data?  If not, you'll need to change your logic for the number of elements to initialize.
    As Altenbach said, this seems a lot like a basic logic/homework problem.  My suggestion was only that-a suggestion.  It is not the only way to do this. Figure out a sequence of steps to get you from point A to point B before you jump in and start coding. 
    Regards,
    Tom L.

  • Passing parameters to the SQL Report from a text box in jsp

    Hi All,
    I want to dynamically generate the SQL Server Reporting Services by passing the query parameter from the url like this :
    "http://localhost/Reports/Pages/Report.aspx?ItemPath=%2fDashboardReports%2fHorse_Profile&rs:Command=Render&rs:HorseID=117415"
    Where horseid id my parameter which is needed by report to generate the required data.
    This query paramter value is picked from the text box on my jsp page.
    But my problem is when i go to this url it says the message
    "The 'HorseID' parameter is missing a value ".
    I have done a lot of search on this topic. Everybody says that we can pass the values from the url like i am using. But still its not working.
    Any body has any idea please give me some idea.
    Regards.

    If you receive a picture via email or text message in ios 7 and when you press the action icon to save the picture and you do not get the option to save to your camera roll. Press and hold on the the image and you will get an overlay pop up to save the image. I have no idea why some attachments don't have option in action menu to save in the camera roll but by experimentation and earned frustration I found the above to work in certain situations.
    Be well and have fun and feel rewarded in your frustrations. For without challenges, life would be an utter bore.

  • Prevent Text Boxes to shrink as big as the text in it - move existing InfoPath form from SharePoint 2007 to SP2013

    Hello Together,
    we have some simple InfoPath forms in place. With SharePint 2007 they are working well. Now we will move to SharePoint 2013.
    It was easy to re-publish them on a SharePoint 2013 Site and to work with, but i have an optical / technical error and i don't find the solution.
    We use Text Boxes to collect the data from the user. After the user has filled the form we will submit them via mail.
    I will you show you the problem.
    on SharePoint 2007 --> it looks okay
    on SharePoint 2013 --> not okay - the Text Box is shrinked to the text Size and the design is defect
    How can i prevent this?
    Thanks in advance
    Sebastian
    I can provide Screenshots, bit at the moment my account is not verfied...

    Can you please share screen shot.
     Before try removing the field form View and  Add it again - check it
    Velu K

  • Move from one text box to another w/o using tool box

    I'm constantly needing to move from one editable text box to another editable text box -- or to a vector graphic and back to a text box. I'd love a keyboard shortcut to move around if there is one.  Having to constantly click the cursor in the tool box to activate a text box is so tiresome.

    Bearskate,
    As I (mis)understand it, from other tools to the Type Tool, you can just press the T key.
    Unfortunately, you cannot press the relevant other key with any kind of Type object selected because that will just add that letter somewhere.
    You can see the keystrokes for the different tools when you hover over them.

Maybe you are looking for

  • How to access a specific folder in my catalog which doesn't appear in my library?

    Hi, I'm trying to access a folder that I've previously imported and classified in my catalog. I don't see it in my library module (but I do see it in through my cpu's finder window). What would be the best way to 'retrieve' them and work with them. T

  • Problem Saving Files CS5

    After years of no problems I am suddenly having a problem saving files.  This started with CS4 a few months ago, and has continued with CS5. When I attempt to Save As... I get an error message:      Could not save as "{location & filename}" because t

  • Excise vendor invoice

    Hi Experts,            Using movement type 122 in MIGO returned all quanity to vendor. For returned delivery document i am capturing excise invoice because to cancel the posted excise invoice. I am getting this error. PLA-AT2 amount 24.03.2009 is gre

  • TC Hard Drive Access over the Internet

    Hello, I have a TC that is connected to my router. I have a fix IP from from my ISP and was wondering if it's possible and if so how can I access the HD of the Time Capsule via a remote computer ? Thanks in advance Vadim

  • Query Oracle client version

    Is there a way to tell the Oracle client version (9i or 10g) that is being used by SQL Developer from within SQL Developer? Our Citirx admin installed 10g client on the server and I am trying to verify that the 10g client is indeed being used by the