My question is I have this for form with couple options and a text box and what I want to do is when user selects the "none" textbox to be enabled and if user chooses "mysite" option textbox to be disabled so user can't put his/her input.
Here is my code:
Code:
<form id="form1" method="post" action="">
<label>
<select name="none" id="noneid" >
<option value="none">None</option>
<option value="mysite">Mysite</option>
</select>
</label>
<label>
Another
<input type="text" name="another" id="anotherid" />
</label>
</form>
I think I need a javascript function to trigger by onchange event to disable or enable textbox depending on the user input. But I don't know how to write that function.
I have a form consisting of nine text fields (labelled 1-9) and nine radio buttons for each of the text fields. I want to enable the radio buttons when text is entered into the field corresponding to that particular radio button. Is there a way of achieving this using a JavaScript onChange event?
came across this forum while searching for an example of how to do something in Javascript, and found the post helpful, but didn't quite answer my query completely... It was a very old thread, few years old, though so I thought best not to revive it from the murky depths :)Basically, I very rarely use JavaScript... in fact, I rarely do any programming at all, but I'm trying to build a basic site at the moment, and I'm wanting to disable/enable a text box based on the value of a drop down menu...The idea behind it is that I have a sub title, and in the admin panel, I want to be able to set whether the sub title is picked randomly from a database, or whether it chooses one, and only one...So in the admin panel, I've got a page that has a drop down menu with two options. Static, and Random. Below this, I've got a text box called Static ID... In this text box, the administrator would insert the database row ID for the specific sub title they want...
Obviously this Static ID field only applies if you select a Static sub title, rather than a Random sub title...So what I want to happen is for the text box to be disabled if the drop down menu is selected as Random... and then enabled if the drop down is selected as Static...So I came across the following script on an old post as mentioned earlier:
<script type = "text/javascript"> function enableTextbox() { if (document.getElementById("dropdown").value == "New") {
I have a gridview with a checkbox (CheckBoxActiveClient) in the first column and a textbox (Copies) in the 5th column. I want that row's textbox (Copies ) to be disabled if the checkbox is unchecked in that row. I wrote a javascript function for this but it doesn't work.
Code: <script type="text/javascript"> function EnableTextBox()
Is there something that will update as soon as the user changes information in a textbox as appose to what onChange does, which is update once the focus has been taken off of the textbox? I am writing a custom cart and I am using AJAX to update the price according to how many they are ordering, I was hoping to have it update the price as soon as the user put in the volume, but it doesnt update until the user clicks somewhere else on the page.
I have a form with pairs of checkboxes. When one is checked then I want to enable the other checkbox for that pair, and disable when unchecked. I can get this to work when I have a separate function for each pair, but not if I try to use one function and pass the id of the element.[code]
i've been looking online for a while for a code that would disable 3 text fields.[code] Was unable to find one. was only able to get it to do one of fields. What i'm try to do is have a checkbox to enable and disable a row and produce a value in the totalcalls box.
function checkdate(FormSubmit){ alert(document.getElementById('Mois').value); if(eval(document.getElementById('Mois'))>0 && eval(document.getElementById('Annee'))>0){ document.forms['FormSubmit'].getElementByID('SELECTCONSTRUCTOR').disabled = false; //can't reach the control here } else { document.forms['FormSubmit'].getElementByID('SELECTCONSTRUCTOR').disabled = true; //can't reach the control here } } ....
this site,I had a problem with my code. I had two radio buttons when i click the first radio button i want to appear one login form(username,password&submit button) and some fields like texbox, radio buttons.here the login form is only in enable state remaining fields must be in disable state. When i click on second radio button then i want to disappear the login form and the remaining fields must be in enable state.here is my code
I have a check box that is active, but everything below it is disabled. I wrote a script to enable it but the error report keeps saying that my function has no properties. Why is this?
function disable_enable(){ if (document.all || document.getElementById){ if (document.printWhere.qtyPrinter.Quality.qtyOffice.Submit.disabled==true) document.printWhere.qtyPrinter.Quality.qtyOffice.Submit.disabled=false else document.printWhere.qtyPrinter.Quality.qtyOffice.Submit.disabled=true } }
i want to disable all the textfield..when user check the radio button(let say the above one), the above textfield (txtAccNum) will be enable..im new to javascript.
In the following code I just want to disable the textbox if “other Amount is selected”, radio element 7.I have been working at this too long cause I can’t see the problem.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>
I was trying to but failed to do. I have two radio of gender and two input box father name and husband name if sex selected male then fathers name will be enabled and husband name will be disabled and if female selected then fathers name will be disabled and husband name will be enabled.
I am trying to do like if country none selected city will be disabled and if usselectedthen city will be enabled.triedby this code but unable to enable city onsection.
I have an ASP page that has a master page. I have a drop down list and 2 text boxes.The change function is being executed and I get the text value of the selected list items, but the enable and disable are not working.[code]
I need to be able to disable a link upon clicking an agreement. Here is what I currently have, I am trying to make a custom button for jcryption.[code]...
I have 2 text boxes I want to control with a select.
I can code this problem myself, but was wondering if there is some better way to do it...
There are 4 values for the select, "", S, R, and B.
When "" is selected I want both boxes to be disabled, When S or R are selected the Stext or Rtext will be enabled respectively When B is selected both will be selected...
So I have the function to handle this in my own custom UI namespace.. Here is the function:
SRB: function() { if ($("#SRB).val() == "B") { // enable both boxes } else if ($("#SRB").val() == "S") {
[Code]....
etc.. i guess you get the picture. Basically the question is, is there a way to do this without statically setting if conditions for each select box condition?
I have form with Name Age Payment Mode (Combo box include payment mode 1, payment mode 2, payment mode 3) When I select a payment mode-01 enableling 5 combo boxes. If select payment mode 2 disabling that combo boxes. How do I do this thing.
I made a small photo application using javascript that displays random pictures like a slideshow. There is text that goes with each picture that is initially hidden but becomes visible when the user clicks on a button. I have the pictures grouped into separate .js files (about 10 per group) and the page selects images at random from all separate files as if they were one. what i need to do is to be able to disable or deactivate certain photo collections by checking/unchecking a box.
then there would need to be two checkboxes (preferably at the bottom of the page), one for each .js file. if box 1 is checked then the images selected are drawn only from slide1.js. if box 2 is selected then images are only drawn from slide2.js. if neither are checked then no images are drawn, and if both are checked then images are drawn from both .js files.
Using Jquery ... How can i disable a button for 3 seconds then after that enable it when a use click a button (to avoid the user clicking without stopping)
Button Enabled -> user click the button -> button is disabled for 3 seconds -> button is enabled .
I have two radio box ()Premium Listing, () Free Listing now I want to disable all those input field (text box) having class="paidfield" when I click on ()Free Listing and enable when I click on () Premium List.I need this in Mootool because my application is using Mootool only.
I have a checkbox at the top of the page, and then I have a form full of text fields etc, called 'frmEnquiry'.
I would like the form to be disabled (or the text fields, elements etc) when the checkbox is not enabled, and when ticked i would like it to be enabled.
I am wanting to make a few fields required after they are enabled, but it's not working well.
<script language="javascript"> function enableAdd(){ document.form1.empJobTitle.disabled=false; document.form1.empExt.disabled=false; document.form1.empEmail.disabled=false; }
function disableAdd(){ document.form1.empJobTitle.disabled=true; document.form1.empExt.disabled=true; document.form1.empEmail.disabled=true; }
function validateCheck(){ if(document.form1.empJobTitle.disabled=false && document.form1.empJobTitle.value==""); alert("You must enter the employee's job title."); return false;
if(document.form1.empExt.disabled=false && document.form1.empExt.value==""); alert("You must enter the employee's extension."); return false;
if(document.form1.empEmail.disabled=false && document.form1.empEmail.value==""); alert("You must enter a valid email address for the employee."); return false; }