PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Ignore tab stop/index on a field

  1. cwoodside
    Member

    I have a data entry form that can go up to 40 lines and need to completely skip a certain field repeated in every line as this is only used in very special circumstances.

    I see in the forum several way to control the entire form, but not individual fields. I'm not at all familiar with php and really don't want to code this, just simply skip the option all the way around. I downloaded the code in hopes of just deleting the function in these fields, but figured out that is must be done otherwise as tab is not in the coding at all.

    I want to skip the DMN field on each line with calling them by name or number inback end code as this could change and would requiring opening up the code every time when all I want to do is make the filed as NO tab stop and skip the code before it is even written.

    I know if I was coding the fields myself, I'd simply delete the tab code for the field and I don't see a way to do this...can you help?

    My form is at http://www.earnvpoints.com/vpadmin/sample-page/

    Thanks!

    Posted 12 years ago on Wednesday August 22, 2012 | Permalink
  2. cwoodside
    Member

    Another tab question...it seems that the Wordress Admin bar add it's own tab indexes, usually 10 and maybe 1 as well that conflict with a field that is already 10...stopping my tabbing mid form. Is there a way around this without removing the admin bar?
    I got the form to work with an admin bar removal plugin, but would prefer to allow users access to the bar.

    Posted 12 years ago on Wednesday August 22, 2012 | Permalink
  3. You can use jQuery to append a negative tabindex value to each element that you'd like to "skip". For example:

    jQuery(document).ready(function() {
    	jQuery("#input_69_7").attr('tabindex','-1');
      });

    You can see a working example here: http://dev.outerhavenstudios.com/calculation-example/

    Put your cursor in the first field and then tab and it will skip the second field. You will just need to identify each element (input ID) accordingly and chain them together or target them as you see fit.

    Posted 12 years ago on Monday August 27, 2012 | Permalink
  4. cwoodside
    Member

    Thanks Rob....I am somewhat familiar with JQuery, but Wordpress is all new to me.
    Where would I call this code...I have gathered that I add it to the theme-functions_php...there must be 1000 references and different ways show to do it....ick...so I could still be wrong:

    function my_init() {
    	if (!is_admin()) {
    		wp_deregister_script('jquery');
    		wp_enqueue_script('jquery');
    
    		// load a JS file from my theme: js/negtab.js
    		wp_enqueue_script( 'negtab-script', get_template_directory_uri() . '/js/negtab.js', 'jquery' );
    	}
    }
    add_action('init', 'my_init');

    If this is correct, then I do an external script with your code above for each neg tab and call it negtab.js and place it in an folder named js----where do I place that folder on my server, in the theme folder?

    Thanks...!

    Posted 12 years ago on Monday August 27, 2012 | Permalink
  5. cwoodside
    Member

    I was just in my themes and saw that there is already a js folder, so this is where my script goes - so ignore that part....Thanks again

    Posted 12 years ago on Monday August 27, 2012 | Permalink
  6. For my test i just placed it in my theme's header.php file (you can view the source on my example link). This page may be of some help to you as well:

    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Posted 12 years ago on Monday August 27, 2012 | Permalink
  7. cwoodside
    Member

    OK, I'll try that....I went to start my actual script and didn't see a way to apply this to only form 1, I wouldn't want to skip these fields on all of my forms...

    OR is that what the 1 refers to in:

    jQuery("#input_1_99").attr('tabindex','-1');

    The 99 is the field label and is the 1 the form number or do I need to call it another way?

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  8. Since you have to target the individual fields - every individual field has it's own unique ID, so it will only apply to those fields you target.

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  9. cwoodside
    Member

    OK, got it, so for mine, I'd use this:
    jQuery("#input_1_103").attr('tabindex','-1');

    or would I use 103_1 - I see both in the code...my form is 1 so looking at your sample code I think that 1_103 is correct....

    Field code:

    <li id='field_1_103' class='gfield gf_inline' style='display:none;'><label class='gfield_label'>DNM</label><div class='ginput_container'><ul class='gfield_checkbox' id='input_1_103'><li class='gchoice_103_1'><input name='input_103.1' type='checkbox' onclick='gf_apply_rules(1,[0]);' value=' ' id='choice_103_1' tabindex='44' /><label for='choice_103_1'> </label></div>

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  10. Actually, I believe in your case you would want to use:

    jQuery("#choice_103_1").attr('tabindex','-1');

    Because you are targeting the ID on the input.

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  11. cwoodside
    Member

    Thanks sooooo much - I finally got it to work...it took me awhile to figure how to call the script as I wanted to host it separate because my theme gets a lot of updates, so I came up with this in the header as you said:

    /**
    * MY CUSTOM INCLUDES
    */
    <script type='text/javascript' src='http://www.earnvpoints.com/vpadmin/wp-content/themes/graphene/js/CHeader-negtabstopform1.js'></script>

    Again thanks!

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  12. cwoodside
    Member

    Me again - Now another form that worked yesterday, has stopped working..

    http://www.earnvpoints.com/vpadmin/downloads/

    The checkbox does not open the conditional logic to finish the form?

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  13. Do you have a login to use to access that page?

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  14. cwoodside
    Member

    Yeah, I added one for you whit the email you contacted me with yesterday:

    u-gravitytest
    pw-1234567

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  15. OK, it looks like you changed the verbiage on the checkbox label option. Which means, you need to reselect that in your conditional logic. Pop open the fields underneath that should be showing with conditional logic and you'll see there are two choices there. The fields are latching onto the old label/conditional logic. So you just need to select the new, correct label choice.

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  16. cwoodside
    Member

    Duh...Don't I feel like an idiot - never even thought of that....

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink
  17. No worries! Glad to help out.

    Posted 12 years ago on Tuesday August 28, 2012 | Permalink

This topic has been resolved and has been closed to new replies.