CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Conditionally adding code to a form

Print topic Send  topic

Author Message
Ricardo J. Méndez Castro
Posted: 02/26/2002, 10:35 PM

Hi,

Sorry for sending such a succint message, but Outlook Express crashed and
took the more detailed version with it.

I want to add some code after a form depending on the value of a field. The
code added to the event would be something like this:

if ($fldfield == null)
{
%>
<p>Field is null.
<p>Add a form here.
<%
} else {
%>
<p>Field is NOT null, so we already have an URL.
<p>Add a hyperlink here.
<%
}

Now, on which event should this code be added for the convenient HTML code
to appear AFTER the form? If I use the form's Close event, it appears on
the very top of the page (defacing the graphical interface); and if I use
the page's Close event it gets added after closing HTML tag (and thus
doesn't show up at all).

Any suggestions are appreciated. Thanks in advance,



Ricardo J. Méndez Castro Sheer Talent Developments
------------------------------------------------------------------------
"The middle of every successful project looks like a disaster."
- Rosabeth Moss Cantor

Alexey Alexapolsky
Posted: 02/27/2002, 2:12 AM

If you use html templates you better use a different
mechanism of echoing data. I suggest you reading this article
"Using templates in CC"
http://www.gotocode.com/art.asp?art_id=91&


--
Alex
CodeCharge Developer


"Ricardo J. Méndez Castro" <rmendez@sheertalent.com> wrote in message
news:a5humt$5q1$1@news.codecharge.com...
> Hi,
>
> Sorry for sending such a succint message, but Outlook Express crashed and
> took the more detailed version with it.
>
> I want to add some code after a form depending on the value of a field.
The
> code added to the event would be something like this:
>
> if ($fldfield == null)
> {
> %>
> <p>Field is null.
> <p>Add a form here.
> <%
> } else {
> %>
> <p>Field is NOT null, so we already have an URL.
> <p>Add a hyperlink here.
> <%
> }
>
> Now, on which event should this code be added for the convenient HTML code
> to appear AFTER the form? If I use the form's Close event, it appears on
> the very top of the page (defacing the graphical interface); and if I use
> the page's Close event it gets added after closing HTML tag (and thus
> doesn't show up at all).
>
> Any suggestions are appreciated. Thanks in advance,
>
>
>
> Ricardo J. Méndez Castro Sheer Talent Developments
> ------------------------------------------------------------------------
> "The middle of every successful project looks like a disaster."
> - Rosabeth Moss Cantor
>
>

Ricardo J. Méndez Castro
Posted: 02/27/2002, 7:52 AM

Thanks for the article, Alex. However, what if I wasn't using templates? Is
there a way? I tried sticking the code into the footer, but in the final
generated PHP the code for the footer if way before any variables are
asigned, so they can't be evaluated.

Thanks in advance,


--


Ricardo J. Méndez Castro http://www.sheertalent.com/rmendez/
-------------------------------------------------------------------
"And a writer? A writer lives the sad truth like anyone else. The
only difference is, he files a report on it."
-- Clark Nova in _Naked Lunch_





"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:a5ibf4$qt5$2@news.codecharge.com...
> If you use html templates you better use a different
> mechanism of echoing data. I suggest you reading this article
> "Using templates in CC"
> http://www.gotocode.com/art.asp?art_id=91&


Alexey Alexapolsky
Posted: 02/28/2002, 2:31 AM

The code you were using is just for non-template version.
When you are in event you simply put closing php tag ?>
and output some html etc.
If you need to output something in Footer , then you put
there <%something like this%>

--
Alex
CodeCharge Developer


"Ricardo J. Méndez Castro" <rmendez@sheertalent.com> wrote in message
news:a5ivbh$uuj$1@news.codecharge.com...
> Thanks for the article, Alex. However, what if I wasn't using templates?
Is
> there a way? I tried sticking the code into the footer, but in the final
> generated PHP the code for the footer if way before any variables are
> asigned, so they can't be evaluated.
>
> Thanks in advance,
>
>
> --
>
>
> Ricardo J. Méndez Castro http://www.sheertalent.com/rmendez/
> -------------------------------------------------------------------
> "And a writer? A writer lives the sad truth like anyone else. The
> only difference is, he files a report on it."
> -- Clark Nova in _Naked Lunch_
>
>
>
>
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:a5ibf4$qt5$2@news.codecharge.com...
> > If you use html templates you better use a different
> > mechanism of echoing data. I suggest you reading this article
> > "Using templates in CC"
> > http://www.gotocode.com/art.asp?art_id=91&
>
>
>

Ricardo J. Méndez Castro
Posted: 02/28/2002, 11:46 PM




> The code you were using is just for non-template version.
> When you are in event you simply put closing php tag ?>
> and output some html etc.
> If you need to output something in Footer , then you put
> there <%something like this%>
>

Cool, thanks Alex. I'll evaluate switching to non-template and just adding
it on the footer.

Good luck,



Ricardo J. Méndez Castro http://www.sheertalent.com/rmendez/
-------------------------------------------------------------------
"Prophecy is ragged and dirty... so make it ragged and dirty."
-- Vaughn in _Crash_



   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.