Results 1 to 2 of 2
  1. #1
    vcl
    vcl is offline Member
    Join Date
    Jun 2011
    Posts
    1
    Rep Power
    0

    Default Problem passing arrayed arguments to a method

    Hello everyone,

    I'm pretty new to java and I'm having problems when passing and element from HTML to a script. I have several rows for a person addresses and when one of those fields change I need to update the value of a flag (that is a hidden element).

    The html looks like:

    <input name="n_address_id[]" value="179" type="hidden">
    <input name="c_chg[]" value="0" type="hidden">
    <input name="c_street[]" onchange="UpdateValue('c_chg[]')" type="text" value="Street name 1">
    <input name="c_number[]" onchange="UpdateValue('c_chg[]')" type="text" value="Street number1">
    <br><br>
    <input name="n_address_id[]" value="180" type="hidden">
    <input name="c_chg[]" value="0" type="hidden">
    <input name="c_street[]" onchange="UpdateValue('c_chg[]')" type="text" value="Street name 2">
    <input name="c_number[]" onchange="UpdateValue('c_chg[]')" type="text" value="Street number2">

    And the script:
    function UpdateValue(x)
    {
    x.value = 1;
    }

    This script works fine when it is a unique input but I'm having a really hard time when I have an arrayed structure.

    I'm working on PHP in combination with JScript.

    Any help will be really appreciated.

    Thanks and Regards,

    V

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Java is to JavaScript as ham is to hamster

    Java != JavaScript

    You may want to find a JavaScript forum for better help.

Similar Threads

  1. Passing arguments to jar file with a pipe
    By clover in forum New To Java
    Replies: 7
    Last Post: 06-27-2011, 05:36 PM
  2. Passing array arguments into main
    By JohnDas in forum New To Java
    Replies: 12
    Last Post: 11-10-2010, 04:00 PM
  3. passing arguments
    By mac in forum New To Java
    Replies: 3
    Last Post: 04-08-2010, 12:30 AM
  4. Replies: 6
    Last Post: 04-05-2010, 10:58 PM
  5. method that return 2 arguments
    By itaipee in forum New To Java
    Replies: 19
    Last Post: 01-12-2009, 06:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •