[Grok-dev] AddForm Mystery Number

Sebastian Ware sebastian at urbantalk.se
Sun May 31 03:13:51 EDT 2009


Maybe this answers your question:

http://grok.zope.org/documentation/tutorial/work-with-forms

Mvh Sebastian

31 maj 2009 kl. 05.03 skrev Steve Schmechel:

>
> This may be more of a FormLib or zope.app.file question, but I came
> across it while working with the Grok how-to
>
> "Handling file uploads with zope.app.file and zope.file"
> http://grok.zope.org/documentation/how-to/uploading-file
>
> When looking at the view created by:
>
> class Upload(grok.AddForm):
>    grok.context(FileContainer)
>    form_fields =  
> grok.AutoFields(zope.app.file.interfaces.IFile).select('data')
>
> you can see that the HTML for the submit button is generated like:
> <input type="submit" id="form.actions.4164642066696c65"  
> name="form.actions.4164642066696c65" value="Add file"  
> class="button" />
>
> Where does the "magic number" 4164642066696c65 come from?
>
> Instead of moving to a separate page to upload a file, I want to  
> include
> file selection on the "Index" page along with the file listing.
>
> I am able to post to the "upload" view from my listing page as long as
> my submit button includes "form.actions.4164642066696c65".
>
> This number seems to be very static.  I've restarted the server,  
> created
> new root applications, accessed the site from other clients.  It all  
> works
> great, but I am fearful it will one day stop working because I did not
> understand the meaning of this number.
>
> Other grok.AddForm views do not generate this type of submit button.
> They look like:
> <input type="submit" id="form.actions.add" name="form.actions.add"  
> value="Add" class="button" />
>
> Can someone please shed some light on this number?
> Should I not post to an auto-generated AddForm view from another view?
>
> Thank you,
> Steve
>
>
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev



More information about the Grok-dev mailing list