Gray out or disable text box

Hi,
     I have a drop down menu called CN_Entry_Initials that has options of a "C" or an "N". I also have a text box called Part_Number to enter a part number into. I want the Part Number text box to be grayed out or disabled until either a "C" or an "N" has been chosen out of the CN_Entry_Initials drop down menu. I have this working, except that I cannot get the Add button to do anything. I think it’s something to do with the way I have the If statement for this disabled text box, or do I have to change the button to a submit button. Does anyone know how to fix this? Below is the javascript and the drop down menu and text box code along with the Add or submit button. There is extra stuff in the Javascript that I have on the page, but I don't need to worry about those things since they are working correctly. I have the disabled text box code at the top of the javascript under the function verify() code. Thanks.
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Wayne Nolting ([email protected]) -->
<!-- This script and many more are available free online at -->
<!-- Begin
function verify()
if (document.getElementById('CN_Entry_Initials').value == "C"
|| document.getElementById('CN_Entry_Initials').value == "N")
    document.getElementById('Part_Number').disabled = false;
else
    document.getElementById('Part_Number').disabled = true;
var PartNum=document.AddECNumber.Part_Number.value;
var regularExpression = new RegExp(/[cC][0-9]/); //regular expression to check for a letter C followed by a number
if(regularExpression.test(PartNum)&& document.AddECNumber.CN_Entry_Initials.value == "N" && document.AddECNumber.Validation_Qty.value == "") { //this will return true if the input passes the regular expression
alert("Enter a Validation Quantity for this new Custom");
else if(document.AddECNumber.CN_Entry_Initials.value == "N" && document.AddECNumber.P_Drive_Docs_Initials.value == "i") { //this will return true if the input passes the regular expression
alert("You cannot select 'i' for docs to be removed for a new part");
else if(document.AddECNumber.CN_Entry_Initials.value == ""  && document.AddECNumber.SW_Model_Only.value == "0") { //this will return true if the input passes the regular expression
alert("ECO type required - Select (N)ew or (C)hange for eco line item");
else if(document.AddECNumber.PNR_BOM_Change_Only.value == "1" && document.AddECNumber.CN_Entry_Initials.value != "C" && (document.AddECNumber.Release_Status_Initials.value == "U"
|| document.AddECNumber.Release_Status_Initials.value == "N")) { //this will return true if the input passes the regular expression
alert("ECO type required - Select (C)hange for eco line item and Select N for Release Status if PNR/BOM Change Only is yes");
else if(document.AddECNumber.PNR_BOM_Change_Only.value == "1" && document.AddECNumber.CN_Entry_Initials.value == "C" && document.AddECNumber.Release_Status_Initials.value == "U") { //this will return true if the input passes the regular expression
alert("ECO type required - Select (C)hange for eco line item and Select N for Release Status if PNR/BOM Change Only is yes");
else if(document.AddECNumber.Doc_Changes_Only.value == "1" && document.AddECNumber.CN_Entry_Initials.value != "C") { //this will return true if the input passes the regular expression
alert("ECO type required - Select (C)hange for eco line item since Doc Changes Only is yes");
<!--- else if (document.AddECNumber.P_Drive_Docs_Initials.value == "i")
// self.location='eco_search.cfm'; --->
else
document.AddECNumber.submit();
//  End -->
</script>
<cfform name="AddECNumber" action="add_new_ec_number_action.cfm" method="post">
<tr>
<td class="edit" align="right">Change or new entry:</td>
<td>
          <select name="CN_Entry_Initials" id="CN_Entry_Initials" onchange="verify();">
            <option value="">Select</option>
<!--------- POPULATE SELECT BOX WITH P_Drive_Docs_Initials FIELDS --------->
            <CFOUTPUT QUERY="ShowCNEntryInitials">
            <option value="#CN_Entry_Initials#">#CN_Entry_Initials#
            </CFOUTPUT>
          </select>
</td>
</tr>
<tr>
<td class="edit" align="right" valign="middle">Part Number:<br><h6>(Limit to 25 characters)</h6></td>
<td><input type="text" name="Part_Number" id="Part_Number" maxlength="25" size="27" disabled="disabled"></td>
<td><textarea name="Description" cols="30" rows="3"></textarea></td>
</tr>
<input type="button" value="Add" onclick="verify();">
</cfform>
Thanks.
Andy

I don't understand about using the alert box to output the variables. I know that everything was working with alert boxes, etc. before I added the code for the disable text box code. The difference I see is on the disable text box code I use document.getElementById and on the other code I use document.AddECNumber. Could this cause the Add button to not work? If so, how do I change this code to make it work? I tried just changing it be like the document.AddECNumber code, but that didn't work.
Andy

Similar Messages

  • Why is the camera icon grayed out in the text message screen so that I cannot text a picture on my iPhone 5?

    Why is the camera icon grayed out in the text message screen so that I cannot text a picture on my iPhone 5? I have an unlocked TMobile phone. My husband has the same phone, plan, and set up; his picture messages work fine.

    Check this it maybe the problem
    Settings > Messages > MMS Messaging > is it on?
    Hope that helps

  • SUBTITLES CUT OFF AND OUT OF BOUNDING TEXT BOX

    SUBTITLES CUT OFF AND OUT OF BOUNDING TEXT BOX
    by Ben Martin on Jun 24, 2008 at 9:57:39 am
    I use Encore version 2.0 and have problem with subtitles on a 30 minutes video. I have not imported these subtitles, but made them, one clip at the time. The first 10 minutes is fine, each subtitle is within a bounding box (the bounding box was stretched up to the first inner rectangle of the Safe Area). They can be seen fine on the timeline and on the DVD.
    However from one particular subtitle onwards, all the subtitles clips seem to suffer from the same problem. When I play them on the timeline the long subtitles are cut off at the right end. When I click on them within the monitor, I see that they are not within a normal bounding box. Instead the text is sort of "embedded" within a structure of white squares (similar to a bounding box), but any attempt to strecth that "structure" by pulling a square with a text tool, only deform and extend the text itself.
    I have tried to create a blank subtitle clip after the last "good" one, using the Add subtitle button on the monitor, but it won't create an empty bounding box within which I could type or paste the text. It works if I try to create an empty clip in the "good" area of the time line (the first 10 minutes), but not before or after that first bad clip I mentioned above. It is as if there was something bad on the timeline and any attempt to create a proper bounding box clip is impossible.
    Is there a setting that I can change? or is it a bug in the programme?
    Any help would be appreciated. Thanks.
    Ben Martin
    Payday

    In order to aviod stretching the existing text, you must use text tool to resize the boundry box.

  • HP LASERJET 2200d - Optional TRAY 3 is grayed out in the print box - 10.2.8

    I just added the optional 3rd tray to the bottom of my LASERJET 2200d. I did a print test directly from the printer and it printed a copy from that tray without a problem. But when I try to print from an application, tray 3 cannot be selected in the print box and is grayed out. Anyone?

    Have you gone into Printer Center/Printer Setup Utility, click on your printer and click on the Utility button? Sometimes that has extra features that you can turn on. Maybe you need to tell the software side that the tray has been added to the printer.

  • Disable text Box On Selection screen

    hello guys,
    I am making a selection screen report in which i want to disable the text box , when i am selecting a particular radio button.
    Kindly, let me know how to do the same.
    Thanks &  regards.
    Kirtish

    hi kirtish
    if u want to disable the text box on the screen, u need to use the screen table. 
    see. All fields of the current screen are stored in the system table SCREEN with their attributes.
    so when u click on the any element of the screen the sceen table is looped through.
    use the following code in at selection screen output .
    put the name of the text box in the
    ex:
    LOOP AT SCREEN.
    IF SCREEN-NAME = <FIRST RADIO BUTTON>
    (IF p_r1 = 'X'. say p_r1 is your radio button name)
    LOOP AT SCREEN.
    IF SCREEN-NAME = <text box>
    SCREEN-INPUT = OFF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    in case of query please reply.
    award if useful
    Varun

  • Cursor with grayed out block of text is only thing on screen

    My husband was playing Solitaire on IMac and screen froze.  I rebooted and white screen came on with cursor and a block of grayed out text.  Any ideas?

    The iPad was telling you that you have to activate it within iTunes by connecting to your computer. The cable pointing to iTunes .... That is the very first thing you should have done. It will not work until it is activated.
    Does your computer meet the minimum requirements?
    PC with USB 2.0 port
    Windows 7; Windows Vista; or Windows XP Home or Professional with Service Pack 3 or later
    iTunes 10.2 or later recommended
    (free download from www.itunes.com/download)
    iTunes Store account
    Internet access
    Try rebooting your computer, make sure that you have the latest version of iTunes installed, then try connecting again to a 2.0 USB port on your PC. Do no connect to a hub.
    If the device is still not recognized in iTunes read this.
    http://support.apple.com/kb/ts1538

  • Iphone 6 keyboard grayed out when opening text message

    when i receive a text message and click on the messages icon, the message shows up but they keyboard is grayed out for a second before becoming visible…has anyone noticed that? i have never noticed it on other iPhones its weird

    I have had my Iphone 5 for two months now and have had this issue on the origianl and a new replacement Iphone 5. I have gone to the genius bar twice already. The first time they reset the phone, wiped it clean and re-downloaded all of the software to the phone. They told me to try it out for a week or so. It kept on happening. Everytime I got a text message, (from the locked screen) I would swipe to open and it would crash and give me the apple symbol for about 20 seconds. I have restarted, hard reset the phone, restored from backup as well. Two phones having the same issue? If it happens again I'll set up a third appointment with the genius bar for a possible third new Iphone 5.
    Iphone5, iOS 6.0.1

  • Disable text box on selecting a checkbox of multiple selection lookup field in infopath 2010

    Hi
    In edit mode of the form,
    We have added one field in infopath which is lookup column and shows multiple selection chekboxes.
    One of the option from that lookup checkbox list is "Other".
    There is one textbox field which will be disabled by default.
    We want to enable this text box on selection of "Other" from lookup field checkbox list.
    Is it possible?
    if yes how can we do this?

    Hi Vyanky, I don't believe that's possible without some major functionality. The problem, as you probably know, is that it's a lookup with checkboxes. If it was added directly in InfoPath, then it wouldn't be an issue. You should consider adding "Other"
    as a separate yes/no field instead. That way you'll be able to add an action rule to it to enable the text box.
    cameron rautmann

  • URGENT!!! How can I disable text boxes in JSP / Java Script??

    Hi! Hope you can help me with this one. It's kinda am having difficulty disabling / enabling text boxes in my JSP or JavaScript code. How can I do this? thanks a lot in advance...GOD BLESS!!

    I'm not really sure with Netscape browsers but with IE 4.0 and above there are two properties you can add to the <input> tag. They are Disabled and Readonly:
    <INPUT TYPE="text" VALUE="testing" DISABLED />
    <INPUT TYPE="text" VALUE="testing" READONLY />

  • Lose focus when tabbing out of autoSubmit text box in IE

    Hey,
    Using JDEV 11.1.1.4 I have a problem with tabbing from one textbox to another textbox in IE. Both text boxes have autoSubmit=true and to reproduce the problem it's like so:
    I type a value or edit the existing one into text box 1 and press Tab. The submit is done and focus is given to the second text box but only momentarily before it loses focus. The focus then is given to the window it would appear, because if I press Tab again it begins from the top of the page. This is only happening in IE (v8 is all I have tried so far). This ONLY happens when the value of the second box is null. If it has a value all works fine.
    I tried implementing various solutions including using the ExtendedRenderKitService to write javascript to the client from the bean to set focus on the text box after the partial render. The javascript is called and focus is set but then something else calls blur on it afterwards. I have verified this by putting a blur event listener on it and it gets called after I set focus on it from my own javascript!
    Has anyone experienced something similar? Just to note: It only happens in IE, and it only happens when the second text box is empty.
    Thanks,
    Ross

    Hey John,
    In reply to your message
    1). Tried on 11.1.1.6 to see if the issue is still there?Not really an option to try and upgrade and test if it works there.
    2). Made a simple test case removing as many variables as possible (e.g. do a simple screen with no DB interaction and only two fields) to see if it reproduces or it's something with your screen?Tried this an it works fine which means it is something unique to my code.
    3). Filed an SR at https://support.oracle.com with your test case
    As above it looks like it's not a problem with ADF so I will keep looking at it.

  • Why is the "extrude to 3D" grayed out in my Text menu???

    I just upgraded from CS4 to CS6 Design Web Premium Extended version.
    I'm working on a mac with OS 10.6.8.
    I have plenty of ram etc.
    I've tried several tutorials to see what the 3D features are, but I can't even get past step 1 of selecting the extrude to 3D option.
    I've tried selecting the layer and still grayed out.
    I tried selecting the copy with the type tool and still grayed out.
    What am I doing wrong??

    I'm assuming you're referring to my graphics card? Sorry, I'm so not technical at all...well some...but not much.
    This is my graphics card info:
    NVIDIA GeForce 7300 GT:
      Chipset Model:          NVIDIA GeForce 7300 GT
      Type:          GPU
      Bus:          PCIe
      Slot:          Slot-1
      PCIe Lane Width:          x16
      VRAM (Total):          256 MB
      Vendor:          NVIDIA (0x10de)
      Device ID:          0x0393
      Revision ID:          0x00a1
      ROM Revision:          3008
    Thanks so much for your help btw!

  • Make cells of Table control grayed out(input disabled) based on condition

    Hello Experts,
    I have a requirement where the data is getting populated in table control from my custom tables.
    Now in three columns of the table control if the data is coming as blank from z table then I have to show the cell as editable so that user can put the data and it can be saved back in custom table but If some data is coming from custom table and it is shown in the table control then the cell should be grayed out(Non Editable).
    To achive this I'm using the Following piece of code but it is not working still.
    In PBO 
    loop at   gi_actual_tc
           into gw_actual_tc
           with control tc_actual
           cursor tc_actual-current_line.
           module tc_get_lines. 
    endloop.
    MODULE tc_get_lines OUTPUT.
    data : lv_index  TYPE sy-index,
           lv_index1 TYPE sy-index.
    lv_index = sy-tabix.
    CHECK gw_actual_tc-zlc_subcon IS NOT INITIAL.
    LOOP AT SCREEN.
      IF screen-name = 'GW_ACTUAL_TC-ZLC_SUBCON'.
         lv_index1 = sy-tabix.
         IF lv_index = lv_index1.
         screen-active  = 0.
         exit.
         ENDIF.
        screen-intensified = 1.
      ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    ENDMODULE.    
    Please let me know where I'm missing the trick here.
    Thanks,
    Jai

    hi ,
    LOOP AT SCREEN.  
    IF ( screen-name = 'GW_ACTUAL_TC-ZLC_SUBCON' AND
    gw_actual_tc-zlc_subcon IS NOT INITIAL )
    OR ( screen-name = ' GW_ACTUAL_TC-ZLC_SCWORK' AND
    gw_actual_tc-zlc_scwork IS NOT INITIAL )
    OR ( screen-name = 'GW_ACTUAL_TC-ZLC_VALJOB' AND
    gw_actual_tc-zlc_valjob IS NOT INITIAL ) .
    change code  to  below code  if it is character field 
    IF ( screen-name = 'GW_ACTUAL_TC-ZLC_SUBCON' AND
    gw_actual_tc-zlc_subcon IS  INITIAL )
    OR ( screen-name = ' GW_ACTUAL_TC-ZLC_SCWORK' AND
    gw_actual_tc-zlc_scwork IS  INITIAL )
    OR ( screen-name = 'GW_ACTUAL_TC-ZLC_VALJOB' AND
    gw_actual_tc-zlc_valjob IS  INITIAL ) .
    IF field is type P or I 
    then
    IF ( screen-name = 'GW_ACTUAL_TC-ZLC_SUBCON' AND
    gw_actual_tc-zlc_subcon =0 )
    OR ( screen-name = ' GW_ACTUAL_TC-ZLC_SCWORK' AND
    gw_actual_tc-zlc_scwork =0 )
    OR ( screen-name = 'GW_ACTUAL_TC-ZLC_VALJOB' AND
    gw_actual_tc-zlc_valjob =0 ) .
    screen-input = 1.
    MODIFY SCREEN .
    ENDIF.
    ENDLOOP.
    regards
    Deepak.

  • Textedit - why is bold grayed out after selecting text?

    I have some RTF files where both bold and italics are grayed out in TextEdit.
    Seems to be the entire file.  Doesn't seem to matter what test I select.
    Other RTF files do not have this problem.
    What happened to the files and how do I fix it?
    Thanks!

    Dear Steve,
    It’s not a Preferences problem; I tried opening the file with Preferences turned off, and the problem still existed.
    I think I’ve found the answer, from one of the plug-in developers. He told me to uninstall and reinstall the app. I’m in the process of doing so and will report back to you the results.
    Many thanks, again, for your expertise and help!
    Be well.
    Rich. Weisman
    DUKE & COMPANY : TYPOGRAPHERS
    56 North Waterloo Road
    Devon Pennsylvania 19333
    610 687-1505
    [email protected]

  • FF was running fine. My cursor jumped out of the text box while i was typing and now no text box on FF will let me type in it? Help!

    Basically as above, i opened a new tab to search for an article and as i was typing the cursor jumped out of the box without my realising. I placed the cursor back in the box and started but no characters appeared. I tried the URL bar and again nothing. I opened Chrome and it worked fine so clearly something ive managed to do but i have no idea what!
    I didn't use any shift, alt or ctrl buttons accidentally. I have tried shutting FF down and reopening but nothing.
    Can anyone help please?
    As an addition, why does the cursor jump out like that?
    Thanks

    Hello darrendons, try disabling graphics '''hardware acceleration'''. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Did this fix your problems? Please report back to us!
    Thank you.

  • Can't disable a hyperlink in a text box

    Hi
    I'm having trouble with Pages '06 and how it handles text that looks like a URL. I'm putting together an ad that has a text box with some text like www.domain.com. I've selected the text and de-selected the 'Enable as Hyperlink' option as I don't want the link line to appear under the text in the printed page.
    My problem is that the change doesn't 'stick'. When I de-select the option, the text colour changes to black and the link line disapears. As soon as I click out of the text box, it reverts back to a hyperlink complete with blue colour and underlining.
    If I place text directly onto the page - not in a text box - it works as expected.
    I've tried this in Pages '05 and it works as expected. I've deleted the prefs files... any suggestions?
    Thanks!
    James

    The setting is now in the 'Auto correction' pane... and yes - it solves the problem! Thanks for that!!! Now I can manually set the link detection. Looks like someone got the 'AutoDetection' routines a bit messed up...
    Thankyou for the suggestion!!!
    James

Maybe you are looking for