Save Next Tab

From PikaDocs

Posted by Andrew Cameron
Legal Services Lawline of Vermont (http://www.lawlinevt.org/) and Vermont Legal Aid (http://www.vtlegalaid.org/)
Code by Dave Kuchler
Pika Software (http://www.pikasoftware.net/)


On the case screens, add a save button that will direct you to another tab after saving the info.

Example here: Example of Save, Next Tab (http://pikasoftware.net/docs/index.php/Image:Able-case-compen.PNG)

Example code for this is from Dave Kuchler of Pika Software.

Your typical save button code looks like this:

<input type=submit name="update_case" value="Save" tabindex=1 
class="save" accesskey="s"/>

Example 1 for "Save, Next Tab":

<input type=submit name="update_case" value="Save, Next Tab" tabindex="2" 
class="save" onclick="document.forms.ws.screen.value='docs';">

Dave's explanation of the above: This will create a "Save, Next Tab" button that links to the Documents tab. Substitute the appropriate tab abbreviation with docs to get the tab you want.

Example 2: (this will go to the case info tab)

<input type=submit name="update_case" value="Save, go to Case Info" tabindex="2" 
class="save" onclick="document.forms.ws.screen.value='info';">

As far as I know, this only works among the case tabs. To get your list of case tabs, check your case_tabs menu, that will show you the possible links you can use.

Also, a note about accesskey="s" - this appears to be setting up the ability to hit Alt-s in your browser to press the save key and save a click. If you make new save buttons, you could add that code with a different letter as your jump letter.


Notes tab is a special case

To redirect from the Notes tab you need to do something a bit different.

Example 3:

<input type="submit" name="saveinfo" value="Save, Go To Case Info (for screeners)" tabindex="1" 
class="save" 
onclick="document.forms.ea.act_url.value='case.php?case_id=%%[case_id]%%&screen=info';"/>

Note that the form name is ea not ws as in the other examples. Also note you are updating act_url.value instead of screen.value and of course the URL is construcuted a bit differently.