Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Posts
    36

    Unanswered: value not being passed to next page

    when i submit this form the selORGA value from the dropdown list is supposed to be passed to the next page, however it is not. when i look in the address bar, there is nothing after &Org=

    any ideas? Thanks.


    <%
    StrSQL = "Select Distinct OZTELE Telephone, OZORGA Organization, OZTEXT Description, OZKEYW Additional_Info, TNBLDG Building from OrgZat, Telephone where OZTELE=TNTELE and OZSEQN = '" & Request.QueryString("UniqID") & "';"
    Set adoRS = adoConn.Execute(StrSQL)
    %>

    <script language='JavaScript'>
    <!--
    function validateForm()
    {
    DRChange.cmdSubmit.disabled = true;

    var error = "";

    // Look for empty required fields
    if ( DRChange.txtTEXT.value.length < 1 )
    {
    error += " - Directory Text field cannot be empty.\n";
    }

    // Validate Organization
    if ( DRChange.selORGA.options[0].selected )
    {
    error += " - Selected Organization is invalid.\n";
    }

    // Replace Double and Single Quotes
    var noQuote = DRChange.txtTEXT.value;
    while((noQuote.indexOf("\"")!=-1) || (noQuote.indexOf("\'")!=-1))
    {
    noQuote = noQuote.replace("\"","^");
    noQuote = noQuote.replace("\'","`");
    }
    DRChange.txtTEXT.value = noQuote;

    // Replace Double and Single Quotes
    var noQuote = DRChange.selORGA.value;
    while((noQuote.indexOf("\"")!=-1) || (noQuote.indexOf("\'")!=-1))
    {
    noQuote = noQuote.replace("\"","^");
    noQuote = noQuote.replace("\'","`");
    }
    DRChange.selORGA.value = noQuote;

    if (error.length > 0)
    {
    alert ("An error has occured while attempting to insert your data. The following information is available about the error:\n" + error);
    event.returnValue = false;
    DRChange.cmdSubmit.disabled = false;
    }
    }
    -->
    </script>

    <table width=75% cellspacing='1px'>

    <tr valign='top'>
    //here's where i pass the values to the next page...all values but Org are being passed.************************************
    <form name='DRChange' <% if request.querystring("Type") = "C" then response.write "onSubmit='validateForm()'" %> action='DR_Change_Confirm.asp?Type=<% =Request.Querystring("Type") %>&UniqID=<% =Request.QueryString("UniqID") %>&DN=<% =adoRS(0) %>&Org=<% =Request.Form("selORGA") %>' method=post>
    //***********************************************
    <%
    if request.querystring("Type") = "C" then
    %>
    <td valign='top' align='Left' class='Alert' nowrap>
    Proposed Change
    </td>
    <%
    else
    end if
    %>

    <td valign='middle' nowrap class='Grid'>
    <input type='Hidden' name='txtUniq' size='' value='<% =Request.QueryString("UniqID") %>' <% if request.querystring("Type") = "D" then response.write "readonly" %>>
    <% ="(" & left(adoRS(0),3) & ") " & mid(adoRS(0),4,3) & "-" & right(adoRS(0),4) %>
    </td>
    //here is my dropdown list*****************************
    <td valign='middle' nowrap class='Grid'>
    <select name="selORGA" onFocus='onSelectFocus(this);' onBlur='this.style.backgroundColor="ffffff";' ID="Select1">

    <%
    if request.querystring("Type") = "C" then
    StrSQL = "Select Distinct ORORGA from OrgCode where ORTCON is not null order by ORORGA"
    Set adoRS2 = adoConn.Execute(StrSQL)
    response.write "<option> - Select Organization - "
    Do While Not adoRS2.EOF
    'if adoRS2(0) = adoRS(1) then
    ' response.write "<option selected>" & adoRS2(0)
    'else
    response.write "<option>" & adoRS2(0)
    'end if
    adoRS2.MoveNext
    Loop
    else
    response.write "<option selected>" & adoRS(1)
    end if
    %>

    </select>
    //************************************
    </td>

    <td valign='middle' nowrap class='Grid'>
    <input type='Text' name='txtTEXT' maxlength=35 size='<% =Len(adoRS(2)) + 8 %>' value='<% =adoRS(2) %>' <% if request.querystring("Type") = "D" then response.write "readonly" %>>
    </td>

    <td valign='middle' nowrap class='Grid'>
    *See Below
    </td>

    <td valign='middle' nowrap class='Grid'>
    <input type='Text' name='txtKeyw' maxlength=15 size='<% =Len(adoRS(3)) + 8 %>' value='<% =adoRS(3) %>' <% if request.querystring("Type") = "D" then response.write "readonly" %>>
    </td>
    </tr>

    <tr>
    <td colspan='100%' valign='bottom' align='Right'>
    <input type='submit' value='Submit' name='cmdSubmit'>
    <input type='Reset' value='Reset'>
    </span>
    </td>
    </tr>

    <tr>
    <td colspan=100% valign='bottom' align='Left'>
    <span id='green'>
    *For changes to Building and Room numbers, please call the Telephone Help Desk at 115.</span>
    </td>
    </tr>
    </table>

  2. #2
    Join Date
    Jan 2004
    Location
    Sydney
    Posts
    11
    Try removing method=post from your form tag or changing it to method=get

  3. #3
    Join Date
    Dec 2003
    Posts
    454
    You forgot to put the value in the tag <OPTION>

    <SELECT Name="FieldName">
    <OPTION Value="?">
    </SELECT>

  4. #4
    Join Date
    Jan 2004
    Posts
    36
    thank you...i knew it was something stupid that i was missing...always is.

  5. #5
    Join Date
    Jan 2004
    Posts
    36
    well...actually....that didn't do the trick.

    here's my insert statement from the page that the info is being sent to.

    StrSQL = "Insert into tblDirectoryCA (DCUNIQID,DCREQID,DCREQDATE,DCAPPROVED,DCAPPRID,DC APPRDATE,DCAPPRREASON,DCTELE,DCORGA,DCTEXT,DCBUILD ING,DCADTLINFO,DCTYPE) values ('" & Request.Form("txtUniq") & "','" & struserid & "','" & Now() & "','N',null,null,null,'" & adoRS3(0) & "','" & trim(Request.Form("selORGA")) & "','" & Request.Form("txtTEXT") & "','" & adoRS3(5) & "','" & Request.Form("txtKeyw") & "','C')"

    all other fields are writing to the database...just not the selORGA.
    i've gone over this a hundred times and can't figure it out...i've handled other cases this exact same way and it works fine.

  6. #6
    Join Date
    Jan 2004
    Posts
    36
    ok...i found it...in my other cases i used txtORGA instead of selORGA...it works now.

Posting Permissions

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