Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Help with clearing variables

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Thanked 0 Times in 0 Posts

    Default Help with clearing variables

    I wonder if someone could help,

    I have a form with 2 drop down menus, when the first drop down menu is changed I don't want the value from the second menu to be submitted ie I want to clear or null the value in the second menu.

    Don't know if I've taken the right approach, the following is what I've but doesn't work

    <td colspan="2" align="right" class="prixTotauxPanier"><?php if ($order->customer['country']['id'] == '') { echo TEXT_DELIVRY_STATE . tep_draw_pull_down_menu('countrieselected', $countries_array, $menu_default_countrie, 'width="230" style="width: 230px" onChange="clearshipping();this.form.submit();"') . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></td>
    <td colspan="2" align="right" class="prixTotauxPanier"><?php if (sizeof($quotes_array) > 1) { echo TEXT_DELIVRY_TRANSPORTEUR . tep_draw_pull_down_menu('shippingselected', $quotes_array, $default_shipping_module, 'width="230" style="width: 230px" onChange="this.form.submit();"') . tep_draw_separator('pixel_trans.gif', '100%', '5'); } ?></td>

    in the header i added the following function

    <script type="text/javascript">
    function clearshipping()
    shippingselected = " "}

  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Washington, DC
    My Mood
    Thanked 636 Times in 540 Posts

    Default Re: Help with clearing variables

    Java != Javascript.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    United Kingdom
    My Mood
    Thanked 294 Times in 227 Posts
    Blog Entries

    Default Re: Help with clearing variables

    Moved thread to - Other Programming Languages

    As KevinWorkman pointed out, Java is not Javascript. I suggest posting in a dedicated JavaScript forum.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. Noob that needs some clearing up with Java style programming
    By looneylu in forum Java Theory & Questions
    Replies: 3
    Last Post: January 23rd, 2011, 11:27 PM
  2. Non-Static variables
    By liloka in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 31st, 2010, 09:13 AM
  3. Clearing text from the console
    By sp11k3t3ht3rd in forum Java Theory & Questions
    Replies: 5
    Last Post: December 3rd, 2010, 05:36 AM
  4. JTextField clearing problem
    By rushhour in forum AWT / Java Swing
    Replies: 1
    Last Post: October 24th, 2010, 12:55 PM
  5. repaint panel without clearing it
    By enflation in forum Java Theory & Questions
    Replies: 5
    Last Post: June 27th, 2010, 04:00 PM