Thank TobyL for pointing that out.
Great start for my first post! By thread I should have said Topic!
I have been reading all of the eForm topics and trying to implement something on my website that I used to used Mambo and FacileForms, but I have decided to redesign using MODx. I have followed the Eform2db topics and have managed to implement a large application form which the user fills and I then get an email and the data is sent to the DB.
The next part is for me to implement a method for updating data they have entered. I have got this to partially work as you say there is an example in the wiki showing db2eForm, but as you say this works for <input> entries, however I then modified in that example name to be a <select> with <options>. In that example I can read the data from the database [+name+] first example is ’tim’.
However as other people in this topic have stated they are struggling to get the <option> with [+name+] in it to be preselected when the form is drawn.
The desired html syntax would be:
<option value="sue" >sottwell</option>
<option value="tim" selected="yes" >timst</option>
<option value="toby" >TobyL</option>
I have been trying to implement something with a snippet call, but having not progress much at present other than grabbing other peoples examples and modifying them for my own means, including many from yourself TobyL. I can not suss this out. I believe this is also what laurentc and goddang were also trying to do.
In your first reply TobyL, you use [+name:tim+] style of notation, what should this return, because it appears to be empty.
I tried creating a snippet CompareOption as a function that takes to params, if the two params are equal then it would:
echo ’selected="yes"’
however, I don’t think I can place the snippet in the eFormMailMe chunk as I am currently:
<option value="sue" [!CompareOptions? ¶m1=`sue` ¶m2=`[+name+]`!] >sue</option>
<option value="tim" [!CompareOptions? ¶m1=`tim` ¶m2=`[+name+]`!] >tim</option>
<option value="joe" [!CompareOptions? ¶m1=`joe` ¶m2=`[+name+]`!] >joe</option>
Can someone give me pointers as to how this can be done?
I do hope that all this makes sense...
Thanks Tim.