CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 field conditions

Print topic Send  topic

Author Message
Roger
Posted: 05/21/2002, 12:33 AM

An idea how I can do this?

I have a Hotel Reservation filed that says Y/N
How do I make some other fields compulsory if it is Y & not compulsory if it
is NO.
e.g. credit card infomation.

Can it be done in CC?
I no knowledge of javascripting.
I am using PHP+Temp & MySQL.

Thanks in advance.

----------------------------------------------
Rgds
Roger


Alexey Alexapolsky
Posted: 05/21/2002, 1:20 AM

If you mean that field content should depend on other fields,
you can access field variables in Form Properties/Events/Before Show :

if ($fldquestion == "Y") {$fldother_field = "some content";}

If you refer to hiding certain fields based on conditions,
please refer to this article :
http://gotocode.com/art.asp?art_id=56&

--
Alex
CodeCharge Developer


"Roger" <rtng@web4u.com.sg> wrote in message
news:acct93$fu3$1@news.codecharge.com...
> An idea how I can do this?
>
> I have a Hotel Reservation filed that says Y/N
> How do I make some other fields compulsory if it is Y & not compulsory if
it
> is NO.
> e.g. credit card infomation.
>
> Can it be done in CC?
> I no knowledge of javascripting.
> I am using PHP+Temp & MySQL.
>
> Thanks in advance.
>
> ----------------------------------------------
> Rgds
> Roger
>
>
>

Roger
Posted: 05/21/2002, 8:00 AM

Maybe I was not so clear. Let me try again.

I have this field call Hotel. If (before submission) the user choose Y then
the Credit Card, Expire Date, CC Name fields must be filled or else it
cannot be submitted. If the Hotel field is N, then the rest of the fields
are not compulsory.

Is it possible like
if ($fldHotel == "Y") then show message and cannot submit? Something like
that in PHP?

----------------------------------------------
Rgds
Roger

"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:acd00g$l14$2@news.codecharge.com...
> If you mean that field content should depend on other fields,
> you can access field variables in Form Properties/Events/Before Show :
>
> if ($fldquestion == "Y") {$fldother_field = "some content";}
>
> If you refer to hiding certain fields based on conditions,
> please refer to this article :
> http://gotocode.com/art.asp?art_id=56&
>
> --
> Alex
> CodeCharge Developer
>
>
> "Roger" <rtng@web4u.com.sg> wrote in message
>news:acct93$fu3$1@news.codecharge.com...
> > An idea how I can do this?
> >
> > I have a Hotel Reservation filed that says Y/N
> > How do I make some other fields compulsory if it is Y & not compulsory
if
> it
> > is NO.
> > e.g. credit card infomation.
> >
> > Can it be done in CC?
> > I no knowledge of javascripting.
> > I am using PHP+Temp & MySQL.
> >
> > Thanks in advance.
> >
> > ----------------------------------------------
> > Rgds
> > Roger
> >
> >
> >
>
>

Alistair McFadyen
Posted: 05/21/2002, 8:27 AM

Roger

You could generate a Custom Action, and amend the validation routine from
the original, something like this

if(!strlen($fldCreditCard))
$sfrmproductdetailsErr .= "Please include your Credit Card
details.<br>";

to this

if($fldHotel=="Y") {
if(!strlen($fldCreditCard))
$sfrmproductdetailsErr .= "Please include your Credit Card
details.<br>";
}

so that the request for Credit Card details would only be generated if
$fldHotel is "Y"


Alistair McFadyen




"Roger" <rtng@web4u.com.sg> wrote in message
news:acdndh$2l7$1@news.codecharge.com...
> Maybe I was not so clear. Let me try again.
>
> I have this field call Hotel. If (before submission) the user choose Y
then
> the Credit Card, Expire Date, CC Name fields must be filled or else it
> cannot be submitted. If the Hotel field is N, then the rest of the fields
> are not compulsory.
>
> Is it possible like
> if ($fldHotel == "Y") then show message and cannot submit? Something like
> that in PHP?
>
> ----------------------------------------------
> Rgds
> Roger
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:acd00g$l14$2@news.codecharge.com...
> > If you mean that field content should depend on other fields,
> > you can access field variables in Form Properties/Events/Before Show :
> >
> > if ($fldquestion == "Y") {$fldother_field = "some content";}
> >
> > If you refer to hiding certain fields based on conditions,
> > please refer to this article :
> > http://gotocode.com/art.asp?art_id=56&
> >
> > --
> > Alex
> > CodeCharge Developer
> >
> >
> > "Roger" <rtng@web4u.com.sg> wrote in message
> >news:acct93$fu3$1@news.codecharge.com...
> > > An idea how I can do this?
> > >
> > > I have a Hotel Reservation filed that says Y/N
> > > How do I make some other fields compulsory if it is Y & not compulsory
> if
> > it
> > > is NO.
> > > e.g. credit card infomation.
> > >
> > > Can it be done in CC?
> > > I no knowledge of javascripting.
> > > I am using PHP+Temp & MySQL.
> > >
> > > Thanks in advance.
> > >
> > > ----------------------------------------------
> > > Rgds
> > > Roger
> > >
> > >
> > >
> >
> >
>
>

Alexey Alexapolsky
Posted: 05/22/2002, 4:32 AM

Validation works like this ,
you detect a condition and based on this condition
you assign value to sFormNameErr variable , e.g. to sCustomerInfoErr,
CC check this variable and if it's not empty its contents is displayed
and record is not updated/inserted.


--
Alex
CodeCharge Developer


"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:acd00g$l14$2@news.codecharge.com...
> If you mean that field content should depend on other fields,
> you can access field variables in Form Properties/Events/Before Show :
>
> if ($fldquestion == "Y") {$fldother_field = "some content";}
>
> If you refer to hiding certain fields based on conditions,
> please refer to this article :
> http://gotocode.com/art.asp?art_id=56&
>
> --
> Alex
> CodeCharge Developer
>
>
> "Roger" <rtng@web4u.com.sg> wrote in message
>news:acct93$fu3$1@news.codecharge.com...
> > An idea how I can do this?
> >
> > I have a Hotel Reservation filed that says Y/N
> > How do I make some other fields compulsory if it is Y & not compulsory
if
> it
> > is NO.
> > e.g. credit card infomation.
> >
> > Can it be done in CC?
> > I no knowledge of javascripting.
> > I am using PHP+Temp & MySQL.
> >
> > Thanks in advance.
> >
> > ----------------------------------------------
> > Rgds
> > Roger
> >
> >
> >
>
>


   


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

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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