[TYPO3-english] Passing/Assigning/Inserting $GET GPvar to TS Form

Scotty C superscotty19 at yahoo.com
Thu Apr 2 23:16:27 CEST 2015


Hey Bernd,
So sorry! Stupid Yahoo! I don't why it's doing that! I swear my original email was beautifully formatted! Anyway, not sure if you saw but I arrived at the same conclusion (dataArray != TEXT -> no stdWrap) and found the solution to be (and I hope it formats properly this time):
page.10 = FORMpage.10 { data.cObject = COA data.cObject {    # GOAL: output "Test value: | test_value=label | <_GET['test']>"       # First we generate the static part of the string.    10 = TEXT    10.value = Test Value: | test_value=label |    # Then we collect the data from DB    20 = TEXT    20.data = GP : test  }  dataArray {    10.label = Name:    10.type = name=input    20.label = Nachricht:    20.type = nachricht=textarea,40,10    100.type = submit=submit    100.value = Submit!  } # end dataArray    recipient = test at test.com  layout = <div class="some-class">###LABEL### ###FIELD###</div>}

Thanks again!-Scott.



 
      From: bernd wilke <t3ng at bernd-wilke.net>
 To: typo3-english at lists.typo3.org 
 Sent: Thursday, April 2, 2015 2:23 AM
 Subject: Re: [TYPO3-english] Passing/Assigning/Inserting $GET GPvar to TS Form
   
Am 02.04.15 um 01:07 schrieb Scotty C:
> Hi again everyone,
> I know that if I havePHP: $GET['test'] = "hello"
> ...andpage.10 = TEXTpage.10.data = GP : temp_name
> ... then output will be "hello"
> My problem is, I need to insert that $GET value into an un-edittable form field.
> After looking at TS Ref and seeing that dataArray elements in a form possess stdWrap properties, my kneejerk reaction was to do:
> page.30 = FORMpage.30 {  dataArray {    30.label = Test Value:
>      30.value = {GP : test}    30.stdWrap.insertData = 1  } # end dataArray  recipient = info at example.com  layout = <div class="some-class">###LABEL### ###FIELD###</div>}
> ... but that results in the literal string "{GP : test}" being output after "Test Value:"
> Can anybody tell me how to slap that $GET value into the form field, and then make that field visible but un-edittable?
> Thanks as always!-Scott.
>
How do you manage to deliver all your code so unformatted?
it is real pain to always reformat it to get an idea of your problem.

 > I know that if I have
PHP: $GET['test'] = "hello"
 > ...and
page.10 = TEXT
page.10.data = GP : temp_name
 > ... then output will be "hello"
 > My problem is, I need to insert that $GET value into an un-edittable 
form field.
 > After looking at TS Ref and seeing that dataArray elements in a form 
possess stdWrap properties, my kneejerk reaction was to do:
page.30 = FORM
page.30 {
    dataArray {
        30.label = Test Value:
        30.value = {GP : test}
        30.stdWrap.insertData = 1
    }
    # end dataArray
    recipient = info at example.com
    layout = <div class="some-class">###LABEL### ###FIELD###</div>
}

dataArray.30 is no TEXT object, so your stdWrap will not work in the 
same way than on your TEXT object (page.10). see [1]

I don't know exactly, but you may try something like:

30.value.data = GP:test
or
30.value.cObject = TEXT
30.value.cObject.data = GP:test
or
30.value = {GP:test}
30.value.insertData = 1




[1] 
http://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Form/Index.html



bernd
-- 
http://www.pi-phi.de/cheatsheet.html
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english


   


More information about the TYPO3-english mailing list