in reply to (jeffa) Re: <input type="button"> does not generate parameter=>value pair
in thread <input type="button"> does not generate parameter=>value pair

Thanks jeffa. Suppose I add a text field to the form:
#!/usr/bin/perl -T use strict; use warnings; use CGI qw(:standard); print header, start_html; print ("Submitted:", param(), hr) if param(); print start_form, textfield('text1'), br, submit('button1'), submit('button2'), end_form, end_html ;
Now I need to enter some value into it and press 'Enter'. That way I will get 'button1' in param() - and I need 'button2' instead. I suppose it is due the fact that button1 has tabindex lower than button2... Is there a way to specify tabindex?

By the way, when I pressed 'reply' I saw a button at the top of the screen - looks like my question title was parsed as HTML.

--dda

  • Comment on Re: (jeffa) Re: <input type="button"> does not generate parameter=>value pair
  • Download Code

Replies are listed 'Best First'.
(jeffa) 3Re: <input type="button"> does not generate parameter=>value pair
by jeffa (Bishop) on Jul 16, 2003 at 06:28 UTC
    Ooooooooo ... that's what you are getting at. I recently had a similar problem that i solved by providing another interface. In this case, it was a significant benefit to do so, as it allowed me to enter data quickly (type numbers - tab - type numbers - tab, etc.). If you don't care to code another interface you can still use a simple keyboard trick: when you have finished entering data in the last textbox (assuming there will be more than one), press Tab twice and then the Space Bar once (or Enter key once, but the Space Bar is closer). This should skip over the first button and activate the second.

    Of course, you probably can do this with JavaScript ... but 'JavaScript' ne 'Perl' ;)

    That's odd that your question title was actually parsed ... tye fixed that a while back (see More HTML escaping), but it is possible someone was pmdevilin' around with the source at the time you saw this "Unidentified Formatting Occurence".

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      I wish I could do it without JavaScript too - probably by specifying tabindex properly.

      About question title parsing - you can reproduce it - go to the full thread (<input type="button"> does not generate parameter=>value pair) and click on 'reply' link at the right of my comment - you'll see the square button at the top.

      --dda