Dec 25
John Torres Conditional Statement Help from L8 to L9
Dec 25, 2015; 23:55
John Torres
Conditional Statement Help from L8 to L9
I"m sure there is an easy answer here, but I'm not seeing it as I'm trying to update this conditional statements from L8 to L9.3.1 (Apache server).
I have a page with 2 forms on it. The user can search the database by to find a list of teachers either by searching by the school name or the teacher last name. On the results page, I want to display results based on the following conditional logic using two separate inlines:
If "school_name" is not null then perform a search using the school name field ELSE display and do nothing.
If "teacher_lname" is not null, then perform a search using the lname field ELSE display and do nothing.
The problem I'm running into is that if content inside of the [If][/If] tags is still getting displayed for both conditions vs. just showing 1 of the desired conditions. Something isn't going as planned wither with the variables I'm casting or the If/Else statements I'm using, or something completely else that I'm not seeing.
Here is the code
****SEARCH PAGE****
Search by School:
<form id="school" name="school" method="post" action="list.lasso">
<input name="school" type="text" id="school" value="" size="30" />
<input type="submit" name="" id="" value="Search" />
</form></td>
Search by Last Name:
<form id="lname" name="lname" method="post" action="list.lasso">
<input name="lname" type="text" id="lname" value="" size="30" />
<input type="submit" name="" id="" value="Search" />
</form>
****RESULTS PAGE****
[Var(school) = (web_request->param('school'))]
[Var(lname) = (web_request->param('lname'))]
[If($school != '')]
[Inline( -Search, -Database='OHI_people_directory', -Table='teacher_directory', 'school'=$school, -MaxRecords=All)]
<span class="searchlable">Your search results for "[$school]"</span><br />
[Records]
[Field('school')] - [Field('lname')]
[/Records]
[/Inline]
[/If]
[If($lname != '')]
[Inline( -Search, -Database='OHI_people_directory', -Table='teacher_directory', 'lname'=$lname, -MaxRecords=All)]
<span class="searchlable">Your search results for "[$lname]"</span><br />
[Records]
[Field('school')] - [[Field('lname')]
[/Records]
[/Inline]
[/If]
****END OF CODE****
Any ideas?
John Torres
jjtorres@mac.com
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Dec 25
Carl Ketterling Re: Conditional Statement Help from L8 to L9
Dec 25, 2015; 23:13
Carl Ketterling
Re: Conditional Statement Help from L8 to L9
Dec 26
John Torres Re: Conditional Statement Help from L8 to L9
Dec 26, 2015; 00:26
John Torres
Re: Conditional Statement Help from L8 to L9
Dec 26
Jolle Carlestam Re: Conditional Statement Help from L8 to L9
Dec 26, 2015; 10:07
Jolle Carlestam
Re: Conditional Statement Help from L8 to L9
Dec 26
John Torres Re: Conditional Statement Help from L8 to L9
Dec 26, 2015; 09:24
John Torres
Re: Conditional Statement Help from L8 to L9
Dec 26
Jolle Carlestam Re: Conditional Statement Help from L8 to L9
Dec 26, 2015; 17:33
Jolle Carlestam
Re: Conditional Statement Help from L8 to L9