SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Problem Syntax

  1. #1
    SitePoint Member
    Join Date
    Jul 2004
    Location
    dallas
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Problem Syntax

    Im new to Javascript, and dont know the syntax needed. in this line

    document.testform&&MYCID&&.ESTSTART&&MYCID&&.value;


    MYCID is an Argument thats always a number, what I want is this
    documebt.testform3.ESTSTART3.value


    <Code>



    <input type="text" id="ESTSTART3" onChange="funcmyadd(3);">

    ------------------------


    function funcmyadd(MYCID){

    argeststart = document.testform&&MYCID&&.ESTSTART&&MYCID&&.value;
    document.funcaddme.ESTSTART.value = argeststart;
    document.funcaddme.MM_insert.value = "ADD_ESTSTART";
    document.funcaddme.submit();
    }


    </Code>

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are sure the form controls will have IDs (as opposed to the 'name' attribute), then...

    var argeststart = document.getElementById('ESTSTART' + MYCID).value;

  3. #3
    SitePoint Member
    Join Date
    Jul 2004
    Location
    dallas
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Thank YOU

    Works like a charm =) Now what about this? enable and disable a texfield, except these text fields reside in diffrent forms.
    For example:
    <form name=formA1
    <input name =textA1 (When Empty:Null:THEN
    <form name=formB1 (
    <input name =textB1 ( This field is disabled: else it is enabled

    <form name=formA2
    <input name =textA2 (When Empty:Null:THEN
    <form name=formB2 (
    <input name =textB2 (This field is disabled: else it is enabled

    <form name=formA3
    <input name =textA3 (When Empty:Null:THEN
    <form name=formB3 (
    <input name =textB3 (This field is disabled: else it is enabled

    Exct. Exct. Exct.


    <script>
    function stf(selObj)
    {
    var arg_stf2 = document.('st_d' + selObj).('st_date' + selObj).value;
    if(arg_stf2 == '')
    {

    document.getElementById('CP_DATE' + selObj).disabled = true;
    }
    else
    {
    document.getElementById('CP_DATE' + selObj).disabled = false;
    }
    }
    </script>
    Last edited by SimonFive; Jul 27, 2004 at 12:28. Reason: Another Question


Bookmarks

Posting Permissions

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