Gossamer Forum
Home : Products : DBMan : Customization :

Building select fields with related data

(Page 2 of 2)
> >
Quote Reply
Re: Building select fields with related data In reply to
Well, I don't know if you'll think I'm the best now. Smile

In order to fill in the field while on the add form, based on a selection made in a select list on the same form, you're going to need to use javascript. And I don't know javascript.

I can tell you how to get the value from the other database and add it after the record is submitted, but I can't tell you how to dynamically enter it into a field. I even looked at what I think is the best javascript site -- http://wsabstract.com/ -- but I didn't find anything there, either.


------------------
JPD






Quote Reply
Re: Building select fields with related data In reply to
No your are still clearly way up there. Defeat...pah I laugh in it's face!! Smile

So...how difficult would it be to include a 2nd select that pulls the hours from the other database? Should I just copy the existing sub and name it print_&_build etc_v2 and use that to call the hours?

Not perfect I grant you but a possible workround?

Let me know oh best one Smile (flattery gets you somewhere...)

Rob
Quote Reply
Re: Building select fields with related data In reply to
 Smile


------------------
JPD






Quote Reply
Re: Building select fields with related data In reply to
Hehe...I'll have a fiddle (copying existing sub) and see how it looks. I may concantenate some fields in the database to help too.
Thanks for the advice it is much appreciated and I've ordered "Perl for Dummies", apt I know Smile
Rob
Quote Reply
Re: Building select fields with related data In reply to
Couple of things JPD if you have a minute Smile

Is it possible to use the print&build within a <TD so that it looks part of the form? Currently the html.pl has it at the top of the form outside the table.

Also, how do I remove the "blank" at the top of the select list so that it displays the first option?

Lastly (honest Smile ), is it possible to somehow sort the select list? I'm going to concatenate a text field with some dates so wondered if it could list the latest first?

Thanks a bundle and have a great weekend!!
Rob
Quote Reply
Re: Building select fields with related data In reply to
 
Code:
<tr><td>Contract:</td>
<td>|;
print &build_....;
print qq|</td>
<tr><td>The next field</td>

Code:
<OPTION>---

from the subroutine.

Quote:
is it possible to somehow sort the select list? I'm going to concatenate a text field with some dates so wondered if it could list the latest first?

The list should be sorted already, alphabetically. To sort by another field is something at which my mind boggles! Smile


------------------
JPD






Quote Reply
Re: Building select fields with related data In reply to
JPD - If you have a minute :)

Your print&build from other db functions works great, thanks. However when there is only one record in the selection list (which is displayed but not highlighted) the value from that field is not added because it is not highlighted. Is there any way to make the $output = qq|<SELECT NAME="$column" MULTIPLE SIZE=$size>|; automatically highlight the value?

Hope I made sense?
Rob


> >