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 698 Times in 595 Posts

    Default Re: Help with clearing variables

    Java != Javascript.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  3. #3
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    United Kingdom
    My Mood
    Thanked 288 Times in 225 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.

    Looking for a Java job? Visit - Java Programming Careers

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, 10:27 PM
  2. Non-Static variables
    By liloka in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 31st, 2010, 08:13 AM
  3. Clearing text from the console
    By sp11k3t3ht3rd in forum Java Theory & Questions
    Replies: 5
    Last Post: December 3rd, 2010, 04: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