How to add next and prev button in multiple ADD/EDIT page

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
wpm
User
Posts: 14

How to add next and prev button in multiple ADD/EDIT page

Post by wpm »

Hello!

I have form form for which I used multiple Tabbed ADD/EDIT/VIEW page feature of Phpmaker. There is ADD and Cancel Button in all pages. I want to use Next and Previous butoon till operator reach last page.

Kindly suggest me how to solve this issue.

Thanks in advance.


arbei
User
Posts: 9725

Post by arbei »

There are an option "LastPageSubmit" property of the Multi-Page object.

Read help file topic: "Server Events and Client Scripts" -> "Client Scripts" -> "Example 1".


wpm
User
Posts: 14

Post by wpm »

Thanks a lot for you response sir, nut I could not find out the solution I already created my project and making copy of this code
"
CurrentForm.ewMultiPage.Set({
LastPageSubmit: true, // Enable submit button for the last page only
HideDisabledButton: true, // Hide disabled submit button
HideInactivePages: true, // Hide inactive pages
HideTabs: true, // Hide all tabs
ShowPagerBottom: true, // Show pager at bottom
PagerTemplate: '<nav><ul class="pager"><li class="previous ewPrev"><a href="#"><span class="icon-prev"></span> {Prev}</a></li><li class="next ewNext"><a href="#">{Next} <span class="icon-next"></span></a></li></ul></nav>' // Pager template
LockTabs: true,// Set inactive tabs as disabled
//ShowPagerTop: true // Show pager at top
});
"
userfn12 file then I copied this code in head tag in header file but nothing happen. Kindly suggest me right way. Thanks you.


arbei
User
Posts: 9725

Post by arbei »

Does not need to copy the code to header, just place the code in [Code (Server Events, Client Scripts and Custom Templates)] -> [Client Scripts] -> [Global] -> [Pages with header/footer] -> [Client Script] then try again.

Use [F12] to see if any JavaScript error returned.


wpm
User
Posts: 14

Post by wpm »

Hello Sir,

I am tried so many time but fails. I placed the code where you suggested and also followed help file but it still not working.


arbei
User
Posts: 9725

Post by arbei »

Your code is not correct:

LockTabs: true,// Set inactive tabs as disabled <- extra comma

Use below code and try again.

CurrentForm.MultiPage.Set({
LastPageSubmit: true, // Enable submit button for the last page only
HideDisabledButton: true, // Hide disabled submit button
HideInactivePages: true, // Hide inactive pages
HideTabs: true, // Hide all tabs
ShowPagerBottom: true, // Show pager at bottom
PagerTemplate: '<nav><ul class="pager"><li class="previous ewPrev"><a href="#"><span class="icon-prev"></span> {Prev}</a></li><li class="next ewNext"><a href="#">{Next} <span class="icon-next"></span></a></li></ul></nav>', // Pager template
LockTabs: true// Set inactive tabs as disabled
});


wpm
User
Posts: 14

Post by wpm »

Thanks you very much sir.

I tried it so many time. At last I cleared browser history and it started working.

Thanks again.


vlatha1968
User
Posts: 8

Post by vlatha1968 »

CurrentForm.ewMultiPage.Set({
PagerTemplate: '<nav><ul class="pager"><li class="previous ewPrev"><a href="#"><span class="icon-prev"></span> {Prev}</a></li><li class="next ewNext"><a href="#">{Next} <span class="icon-next"></span></a></li></ul></nav>' // Pager template
//LockTabs: true // Set inactive tabs as disabled
//ShowPagerTop: true // Show pager at top
});

not working for me even though i cleared cookies, browsing history etc. i run the same from another client. Pl. help me out


mobhar
User
Posts: 11905

Post by mobhar »

Just press [F12] from your browser, and check whether any Javascript error message from the "Console" section.

In addition, shouldn't it be "pagerTemplate" instead of "PagerTemplate"?


vintoICT
User
Posts: 435

Post by vintoICT »

This is not working in 2024
error ReferenceError: CurrentForm is not defined


mobhar
User
Posts: 11905

Post by mobhar »

For v2024, you may see Example 1 under Client Scripts -> Table-Specific -> Add/Copy page -> Client Script.


Post Reply