Page 1 of 1
formbuilder pulldown problem
Posted: Thu Jan 11, 2007 6:44 pm
by pumuklee
hi
i have a pulldown in my page
name value
english en
deutsch de
espaniola es
but the result is something like this
Code: Select all
<form id="m3moduleform-1" name="m3moduleform-1" method="post" action="index.php" enctype="multipart/form-data">
...
<div class="languageform"><select name="m3_7"><option value="" selected="selected"> </option><option value="1">deutsch</option><option value="2">english</option><option value="3">espaniola</option></select>
<input name="m3submit" value=">>" type="submit" class="fbsubmit" />
...
</form>
my probelm is that the option values are 1, 2, 3 not en, de, es which i was inserted in admin part
1. how can i handel this problem?
2. how can i change the method of the form to get?
thanks
Re: formbuilder pulldown problem
Posted: Tue Sep 16, 2008 11:48 pm
by TimMansell
Hi, I managed to find a work-around for this. If you have access to the FTP server then try this.
Edit the file called 'PulldownField.class.php' in the folder 'modules/FormBuilder/classes/'.
Change the code:
$subjects = &$this->GetOptionRef('option_name');
if (count($subjects) > 1) {
for($i=0;$iGetOption('sort') == '1' ) {
ksort($sorted);
}
}
To: (changes in red italics)
$subjects = &$this->GetOptionRef('option_name');
$subjects_val = &$this->GetOptionRef('option_value');
if (count($subjects) > 1) {
for($i=0;$iGetOption('sort') == '1' ) {
ksort($sorted);
}
}
Re: formbuilder pulldown problem
Posted: Tue Mar 31, 2009 11:27 am
by Feel
Hello,
This solution helped me a lot. I used it in conjunction with an auto_load of datas in the pulldown menu.
During my tests, I saw that the solution gave by Tim works well only if you have more than 1 entry in the select.
Then I've done the modifications (in red) below :
$subjects = &$this->GetOptionRef('option_name');
$subjects_val = &$this->GetOptionRef('option_value');
if (count($subjects) > 1 && is_array($subjects)) {
for($i=0;$iGetOption('sort') == '1' ) {
ksort($sorted);
}
} else {
$sorted[$subjects] = !empty($subjects_val)?$subjects_val:'1';
}
Hope it helps.
Re: formbuilder pulldown problem
Posted: Sat Apr 25, 2009 11:17 pm
by clc
Hi all,
Thanks! This is exactly what I've been looking for, except that I'm trying to do it with the "Email results based on pulldown" field type instead of the regular "Pulldown" type, and I can't quite get it to work when it comes to the form submission.
I *have* been able to get it to change the option values by editing the similar code (in DispositionDirector.class.php rather than PulldownField.class.php), but I'm getting an SMTP error when I try to submit. Which I'm assuming is because the actual e-mail routing is tied to the numerical option values rather than the subject values. Unfortunately I can't seem to find this part of the code -- can anyone point me in the right direction?
Thanks!
Re: formbuilder pulldown problem
Posted: Sun Apr 26, 2009 2:30 am
by Dr.CSS
Maybe your smtp error is from the mailer not being setup correctly, but if you had given full info we would know because you would have said, my cmsmailer is set right as I can send a test email and it works, something like that...
Re: formbuilder pulldown problem
Posted: Sun Apr 26, 2009 6:22 am
by clc
Hi Mark,
Thanks for the reply -- sorry, I forgot to specify that I only get the SMTP error when I change the option values -- otherwise the mail sending works fine. That's why I'm assuming it's because the routing is tied to the numerical values. I just don't know where to find the formbuilder code that connects the numerical option values back to the e-mail addresses after the form is submitted. Does that make sense? Let me know what further info would be helpful for troubleshooting...
I'm on CMSMS 1.5.4, FormBuilder 0.5.11 and CMSMailer 1.73.14...
Thanks!