Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7703351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:26:16+00:00 2026-05-31T23:26:16+00:00

I am using the below function of javascript to enable and disable the radio

  • 0

I am using the below function of javascript to enable and disable the radio buttons and textbox as the value of drop down changes.
it is fine in starting but as I click on the submit button and if myindex = 8 or 9 at the time of submit it does not work.
At this time radio button filter[0] and filter[1] should be disable and textfield count should be enable I called this function in while selecting dropdown and while clicking on submit button.
I dont know why it is not working. Any Help.

function OnChange(dropdown) {
    var myindex = dropdown.selectedIndex;

    document.form.filter[0].disabled = false;
    document.form.filter[1].disabled = false;

    if (myindex == 8) {
        document.form.filter[0].disabled = true;
        document.form.filter[1].disabled = true;
        document.form.count.disabled = false;
        document.form.submit.disabled = false;
    } else if (myindex == 9) {
        alert("in ALL");
        document.form.filter[0].disabled = true;
        document.form.filter[1].disabled = true;
        document.form.count.disabled = true;
        document.form.submit.disabled = false;

        alert(document.form.filter[0].disabled);
    }

    else {
        document.form.filter[0].disabled = false;
        document.form.filter[1].disabled = false;
        document.form.count.disabled = true;
        document.form.submit.disabled = false;
    }
}

Here is my HTML code below.

<s:form action="crInquiry" name="form" >
    <table align="center" width="1020">
        <tr>
            <td>Batch Id : <s:property value="batchId" />
                <fieldset
                    style="background-color: #F7F9F3; margin: 2px; padding: 8px; -moz-border-radius: 5pt; border: 1px solid #A7CBE3;">
                    <legend class="field_label">
                        <strong>Inquiry Log Status</strong>
                    </legend>
                    <table border="0" id="main_table1" cellpadding="5" width="1010"
                        cellspacing="5" align="center">
                        <tr style="height: 5px;">
                            <td width="300" height="2" align="left" colspan="0"><s:hidden
                                    name="batchId" id="batchId"
                                    onfocus="OnChange((this.form.filterValue));"
                                    value="%{ batchId }"></s:hidden> <s:select
                                    cssClass="bulkSelect" name="filterValue"
                                    label="Search Criteria" required="true" theme="css_xhtml"
                                    labelposition="bottom" tabindex="2" list="headerList"
                                    onchange="OnChange(this.form.filterValue);" />
                            </td>


                            <td width="180"><s:radio name="filter"
                                    requiredposition="right"
                                    list="#{'STATUS_FILTER_START':'START','STATUS_FILTER_END':'END'}"
                                    label="Stage" labelposition="right" theme="css_xhtml"
                                    tabindex="9" labelposition="bottom"></s:radio>
                            </td>
                            <td width="50" height="2"><s:textfield disabled="true"
                                    value="0" name="count" size="2" labelposition="1"
                                    theme="css_xhtml"></s:textfield>
                            </td>
                            <td width="180"><s:radio name="order"
                                    requiredposition="right" list="#{'ASC':'ASC','DESC':'DESC'}"
                                    label="Order" labelposition="right" theme="css_xhtml"
                                    tabindex="9" labelposition="bottom"></s:radio>
                            </td>
                            </td>


                            <td width="50"><s:submit theme="css_xhtml" value="Filter"
                                    align="left" onclick="gotopage('FilteredInquiryLog');"></s:submit>
                            </td>
                            <td width="59"><s:submit theme="css_xhtml" value="Details"
                                    onclick="gotopage('crInquiry')"></s:submit></td>

                        </tr>


                    </table>
                </fieldset>
            </td>
        </tr>

    </table>
</s:form>

and from submit I call the js function from where it call the above js function

function gotopage(actionname) { 
        document.form.action = actionname + ".action";
        document.form.submit();
        OnChange(document.form.filterValue);

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:26:18+00:00Added an answer on May 31, 2026 at 11:26 pm

    It seems odd that you would submit the form and then try to manipulate the fields…

    function gotopage(actionname) { 
            document.form.action = actionname + ".action";
            document.form.submit();
            OnChange(document.form.filterValue);
    
        }
    

    perhaps what you need is :

    function gotopage(actionname) { 
            OnChange(document.form.filterValue);
    
            document.form.action = actionname + ".action";
            document.form.submit();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am adding collection of radio buttons to my page using jQuery below $(document).ready(function()
I am using javascript function for copy/paste (CRTL+V) in textbox. Local run of the
I was reading an article to disable validators in Javascript using below mentioned reference
Javascript and jQuery (Fancybox) question I'm using the Javascript function below for Twitter sharing
i want to implement next previous functionality using below function. - (void)motionEnded:(UIEventSubtype)mt withEvent:(UIEvent *)event
I am using the function below inside a thread to receive the byte[] via
I am using the function below to open the user's default web browser. Public
I am using Serial port to receive the messages. The below function is running
I am using the below jquery code to call a ajax function in my
I have template function compare defined as below. #include<iostream> using namespace std; template<typename T>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.