Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.filemaker > #886
| From | ~consul <consul@dolphinsTAKEAWAY-cove.com> |
|---|---|
| Newsgroups | comp.databases.filemaker |
| Subject | cdml, div, javascript: 1 field with 3 value lists |
| Date | 2012-06-13 12:16 -0700 |
| Organization | the dolphins-cove |
| Message-ID | <jraoup$ege$1@gist.usc.edu> (permalink) |
Now my other weird problem. FMP6
For an online form, students can choose 4 different options: Assignment1, Assignment2, Assignment3, Assignment4.
I had originally made in the database 4 fields with those names.
There are 3 values lists: JEP, YFA, and CODA, and depending on which layout (JEPlayout, YFAlayout, CODAlayout) you are on, I assigned different ValueList dropdowns.
However, on the CDML side, I get a weird result. I have one layout for signups, and in the section of assignment choices, using div and javascript, I made a small table that has all 3 options listed. The javascript lets me show just one of the 3 choices at any time.
In brief, JEP is displayed first as most are using those options. There is a link to click on if you are in YFA or CODA to choose their assignment choices. The html has all 3 there, it's the div that is showing/hiding on a click.
PROBLEM: When I choose an option from the yfa or coda sections and choose some options, it submits online. When I check the database to verify that it did have the correct choice, it sorta does, as it had a carriage returns before and after the choice.
I choose online from YFA:
Place Called Home
I get in the Database:
Place Called Home
If I was in the CODA part, I get 2 carriage returns before/after.
If I was in JEP, I don't get extra carriages, I just get the choices.
I think that with the CDML, if I have different ValueLists point to the same Field in the fmp database, it is sending the "blank" option from the others along with the actual choices. And it seems to give me the carriage returns based on the order of the ValueList in the html.
Is there a way to have it not do that? Or should I just make Assignment1,2,3,4 Fields for each of the 3 sections?
I am trying to shy away from more fields just for the online app.
If you need to see the script & cdml, here it is below:
<tr><th>Assignment Ranking in order of Preference</th><td rowspan="4" width="200"> Some assignments choices are tied to specific courses and may not be available to all students."SA" are Special Assignments which are listed/posted at the JEP House and must be selected & submitted in person.<br />If you are unsure, choose among Mentor, TA, or MiniCourse in JEP Assignments.</td></tr>
<tr>
<script language="javascript">
function showonlyone(thechosenone) {
var newboxes = document.getElementsByTagName("div");
for(var x=0; x<newboxes.length; x++) {
name = newboxes[x].getAttribute("class");
if (name == 'newboxes') {
if (newboxes[x].id == thechosenone) {
newboxes[x].style.display = 'block';
}
else {
newboxes[x].style.display = 'none';
}
}
}
}
</script>
<td>
<div style="border: 1px solid;">
<a id="myHeader1" href="javascript:showonlyone('newboxes1');" >JEP Assignments</a>
</div>
<div class="newboxes" id="newboxes1" style="border: 1px solid black; background-color: #CCCCCC; display: block;padding: 5px;">
<select name="Assignment1stChoice"><option value=""></option>[FMP-Option: Assignment1stChoice, list=Assigned As]</select> First Choice<br />
<select name="Assignment2ndChoice"><option value=""></option>[FMP-Option: Assignment2ndChoice, list=Assigned As]</select> Second Choice<br />
<select name="Assignment3rdChoice"><option value=""></option>[FMP-Option: Assignment3rdChoice, list=Assigned As]</select> Third Choice<br />
<select name="Assignment4thChoice"><option value=""></option>[FMP-Option: Assignment4thChoice, list=Assigned As]</select> Fourth Choice</div>
</td>
</tr><tr>
<td>
<div style="border: 1px solid;">
<a id="myHeader2" href="javascript:showonlyone('newboxes2');" >if you are in Youth & Family Agencies</a>
</div>
<div class="newboxes" id="newboxes2" style="border: 1px solid black; background-color: #CCCCCC; display: none;padding: 5px;">
<select name="Assignment1stChoice"><option value=""></option>[FMP-Option: Assignment1stChoice, list=SiteYFA]</select> First Choice<br />
<select name="Assignment2ndChoice"><option value=""></option>[FMP-Option: Assignment2ndChoice, list=SiteYFA]</select> Second Choice<br />
<select name="Assignment3rdChoice"><option value=""></option>[FMP-Option: Assignment3rdChoice, list=SiteYFA]</select> Third Choice<br />
<select name="Assignment4thChoice"><option value=""></option>[FMP-Option: Assignment4thChoice, list=SiteYFA]</select> Fourth Choice</div>
</td>
</tr><tr>
<td>
<div style="border: 1px solid;">
<a id="myHeader3" href="javascript:showonlyone('newboxes3');" >if you are in Community Outreach through the Development of the Arts</a>
</div>
<div class="newboxes" id="newboxes3" style="border: 1px solid black; background-color: #CCCCCC; display: none;padding: 5px;">
<select name="Assignment1stChoice"><option value=""></option>[FMP-Option: Assignment1stChoice, list=SiteCODA]</select> First Choice<br />
<select name="Assignment2ndChoice"><option value=""></option>[FMP-Option: Assignment2ndChoice, list=SiteCODA]</select> Second Choice<br />
<select name="Assignment3rdChoice"><option value=""></option>[FMP-Option: Assignment3rdChoice, list=SiteCODA]</select> Third Choice<br />
<select name="Assignment4thChoice"><option value=""></option>[FMP-Option: Assignment4thChoice, list=SiteCODA]</select> Fourth Choice</div>
</td>
</tr>
--
"... respect, all good works are not done by only good folk. For here, at the end of all things, we shall do what needs to be done."
--till next time, consul -x- <<poetry.dolphins-cove.com>>
Back to comp.databases.filemaker | Previous | Next | Find similar
cdml, div, javascript: 1 field with 3 value lists ~consul <consul@dolphinsTAKEAWAY-cove.com> - 2012-06-13 12:16 -0700
csiph-web