Hi,
If I want to prevent the form called directly and not from mainForm, what should I do?
for e.g. in a project there are: mainForm, secondForm and thirdForm, I want to make that access to secondForm and thirdForm is only allowed from mainForm and not the user type the address directly.
I have tried using form.isCalledForm(), but it always return false.
(the same thing with form.calledForm())
can I know which form I am in from within code?
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 pm
I just checked this out myself and form.isCalledForm() does return true if you call that form with form.callForm. If you call the second form from the main form with form.gotoForm, form.isCalledForm()will return false.
Based on what you're describing, why not make secondForm and ThirdForm pages instead of seperate forms so you can call form.gotoPage(pagename).
This way, secondForm and ThirdForm can't be accessed by the user until you call gotoPage(). The only reason you might not want to do this is if the form is being accessed from another form.
Based on what you're describing, why not make secondForm and ThirdForm pages instead of seperate forms so you can call form.gotoPage(pagename).
This way, secondForm and ThirdForm can't be accessed by the user until you call gotoPage(). The only reason you might not want to do this is if the form is being accessed from another form.
0 x
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
Hi,
Thanks for pointing my unawareness, I called the 2nd form using gotoForm, that's why it always return false when when using isCalledForm.
I can get what I want now. Thank you.
Actually at first I put all in 1 form, but seems it is getting harder and harder to manage (the fields for e.g.) and lately my pages start getting loss (the form is no longer in the list, the script and database are still there). I don't know if it is something to do with it (put pages in 1 form), but to make sure I can manage it more easily I separate it to several forms.
Jon suggested to upgrade to 5.1, but I haven't a chance to do it until now.
Thanks for pointing my unawareness, I called the 2nd form using gotoForm, that's why it always return false when when using isCalledForm.
I can get what I want now. Thank you.
Actually at first I put all in 1 form, but seems it is getting harder and harder to manage (the fields for e.g.) and lately my pages start getting loss (the form is no longer in the list, the script and database are still there). I don't know if it is something to do with it (put pages in 1 form), but to make sure I can manage it more easily I separate it to several forms.
Jon suggested to upgrade to 5.1, but I haven't a chance to do it until now.
Segi wrote:I just checked this out myself and form.isCalledForm() does return true if you call that form with form.callForm. If you call the second form from the main form with form.gotoForm, form.isCalledForm()will return false.
Based on what you're describing, why not make secondForm and ThirdForm pages instead of seperate forms so you can call form.gotoPage(pagename).
This way, secondForm and ThirdForm can't be accessed by the user until you call gotoPage(). The only reason you might not want to do this is if the form is being accessed from another form.
0 x
Who is online
Users browsing this forum: No registered users and 15 guests