Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    JavaScript


Advertisements:










Jquery :: Disable/Enable TextField In Grails?


I have an edit form which allows users to edit and update on a domain object. I have various text boxes that are of this form:

<g:textField name="name" value="${managementInstance?.name}" />
<g:textField name="websiteUrl" value="${managementInstance?.websiteUrl}" />

Based on the site [URL] I can create a read only and click enabled textbox or textField using jquery, but giving an id and function to every textField is inefficient.

Is there any way I can access each element and provide the disable and enable action?


View 2 Replies (Posted: Nov 10 at 0:11)

Sponsored Links:

Related Forum Messages For JavaScript category:
Disable/enable Textfield
<form name="inputForm">
<body>
<table>
<tr>
<td><input name="inputType" type="radio" value=""></td>
<td>Account Num</td>
<td><input name="txtAccNum" type="text"></td>
</tr>

<tr>
<td><input name="inputType" type="radio" value=""></td>
<td>Service Num</td>
<td><input name="txtSrvNum" type="text"></td>
</tr>
</table>
</form>

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.

Posted: 10-20-2005, 05:51 AM

View 2 Replies!   View Related
Disable Enable A Textfield Dynamically
I was trying to make a textfield dynamic. This is my code

<input type="text" id="test1" value ="dynamic" onfocus="this.disabled=true" onblur="this.disabled=false">
<input type="text" id="test2">

so fields get disabled perfectly but doesnt get enabled on blur. If any one here can solve my problem that would be great.

Posted: Jul 31 at 15:21

View 1 Replies!   View Related
Enable / Disable Textfield / File Field Onfocus Event On Google Chrome
Use default:
<input type="radio" name="restype" value="resdef" onfocus="document.getElementById('resupload').disabled = true; document.getElementById('resadres').disabled = true;" checked="checked" /><br />
Adres:
<input type="radio" name="restype" value="resadres" onfocus="document.getElementById('resupload').disabled = true; document.getElementById('resadres').disabled = false;" />
<input type="text" name="resadres" id="resadres" disabled="disabled" /><br /><br />
[Code]...

This code works in firefox and IE but not in Chrome. Where is the problem?

Posted: Jun 10 at 8:57

View 1 Replies!   View Related
JQuery :: UI Tabs - Clicking A Tab Will Enable / Disable Buttons - Looking To Temporarily Disable Tab Click
I have five tabs right now: New Reports, Old Reports, Judges, Users, and Other Settings. When Judges or Users is clicked, there's a list of users or judges as well as a button that allows you to "Add New User" or "Add New Judge". When one is clicked, that button becomes invisible and some text boxes appear. After you save (or decide to cancel) your new judge or user, the "Add New" button reappears. This all works quite well aside from the fact that if you click the "Judges" or "Users" tab again, the "Add New Button" will appear again even if you're in the process of adding a new one. I'm trying to figure out the best way to prevent this from happening. So far I've tried adding $(this).attr('disabled', 'disabled'); to the click event for Judges and Users, but I don't think that's exactly the right approach.

[Code]...

Posted: Sep 27 11 at 13:57

View 1 Replies!   View Related
Enable A Specific Textfield Using A Radio Button?
I want to enable an 'other text' field when the 'option other' radio button is selected. I can make this work but the form must include more than one radio group. When I try to add another radio group my code causes both text fields to be enabled.

How do I make this work for just one at a time? I looked at adding :eq() to the class but I can't figure out how to make that work.

<script>
$(document).ready(function() {
$('.textclass').attr({disabled:true,enabled:false});
$('.radclass.can').click(function(){

[Code].....

Posted: Sep 3 11 at 14:31

View 1 Replies!   View Related
Disable - Enable Then Disable Again Scrolling In Ipad / Iphone With E.preventDefault();?
I have it disabled already, and I can enable it again. I used:

document.ontouchmove = function(e){
e.preventDefault();
}

In the document.ready(); to disable it. And I used this to enable it.

function doTouchMove(state) {
document.ontouchmove = function(e){
return state;
}
}

I have it so when a user double clicks on an element, the doTouchMove is called. But how do I make it disabled again?

Posted: Aug 23 10 at 13:30

View 2 Replies!   View Related
Disable RightClick On Every Tag Except Textarea And Textfield
I found this cross browser script

<script language=JavaScript>
<!--
var message="Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;
[Code]...

How can I say that the rightlick should work on every textarea and on every textfield tag? I know, users hate it when you deactivate the rightclick! But on my page it is very useful.

Posted: Sep 18 11 at 10:29

View 3 Replies!   View Related
JQuery :: Disable /enable The Elements?
I have div with Textbox, label and hyperlink it it. I want to disable /enable the elements in it. I am using this code.

$('#Content_2 :input').attr('disabled', true);
#Content_2 - is a div

But this leaves the hyerperlink and label enabled. How can modify this ?

Posted: 03-Dec-2010

View 2 Replies!   View Related
JQuery :: Enable And Disable Input Box?
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.

<input type="radio" name="sex" value="male" /> Male
<input type="radio" name="sex" value="female" /> Female </div>
Father's Name<input type="text" name="fname" />
Husband's Name<input type="text" name="hname" />

Posted: 24-Jan-2011

View 2 Replies!   View Related
JQuery :: Enable And Disable Selector
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.

Posted: 02-Feb-2011

View 8 Replies!   View Related
JQuery :: Enable / Disable Are Not Working
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]

Posted: 22-Apr-2011

View 1 Replies!   View Related
JQuery :: Disable And Re-enable A Link?
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]...

Posted: 10-Apr-2010

View 2 Replies!   View Related
JQuery :: Enable And Disable By Select Box?
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?

Posted: 09-Sep-2011

View 1 Replies!   View Related
JQuery :: Disable And Enable ALL Hyperlinks?
I have the below which disables all hyperlinks but after an event I want to enable them back all again, how can I do this?$("a").click(function() { return false; });

Posted: Feb 4 10 at 19:04

View 8 Replies!   View Related
JQuery :: Asp.net Mvc - Enable The Button After Disable
$("#btn").attr("disabled", "disabled");

i have used the above line to disable the button how would i enable it .this is not working

$("#btn").removeAttr("disabled");

Posted: Jun 22 10 at 13:11

View 2 Replies!   View Related
JQuery :: Disable/enable A Button?
how to disable/enable a specific button by jquery ( by name )?

The button does not have ID , just this code:

<button onclick="$('ChangeAction').value='SaveAndDoOrder';" value="Bye" name="SaveAndDoOrder" type="submit">
<i class="Icon ContinueIconTiny"></i>
<span class="SelectedItem">Bye</span>
</button>

Posted: Sep 24 10 at 10:30

View 4 Replies!   View Related
Jquery :: Enable And Disable A Asp.net Button
<asp:Button ID="BtnAddCart" runat="server" Text="Place Order" Width="147px"
onclick="BtnAddCart_Click" Enabled="false"/>

and a checkbox column and checkbox header on a gridview. on the header you select the checkbox all items on the grid are selected. If you uncheck the header checkbox the items on the grid are un selected. here is the Jquery

[Code]....

Posted: Apr 10 11 at 16:18

View 2 Replies!   View Related
Jquery :: Disable And Enable The Textbox?
Here I have a text box

<input name="" type="text" id="txt" onblur="txt(this)"/>

and jquery

function txt(th) {
$(th).hide().after('<span class="dfk">' + $(th).val() + '</span>');
}

I have done disable the textbox and dispaly the value of textbox but again click the value of the textbox. textbox should enable with the value.

Posted: Jul 11 at 8:47

View 2 Replies!   View Related
Jquery :: Disable / Enable All Elements In Div
How to make quick disabling/enabling of all the elements in any div (inputs, links and jQ Buttons)?

Posted: Aug 5 11 at 19:34

View 3 Replies!   View Related
Jquery :: Enable/disable Checkbox In IE?
i want to enable/disable checkbox using jQuery. I am using

$("#checkbox").attr("disabled", true);

This works fine in FF but not in IE.

Posted: Sep 9 11 at 13:33

View 2 Replies!   View Related
Jquery :: Enable / Disable A Dropdownbox
I am new to jquery and now want to enable and disable a dropdownbox through a checkdown box. The code below shows my dropdown and checkdown box

<select id="dropdown" style="width:200px;">
<option value="feedback" name="aft_qst">After Quest</option>
<option value="feedback" name="aft_exm">After Exam</option>
</select>
<input type="checkbox" id="chkdwn2" value="feedback"/>

then How should I write jquery for this ? Also searching for a good documentation/study material for jquery.

Posted: Oct 9 11 at 11:43

View 5 Replies!   View Related
JQuery :: Disable And Re-enable An Element?
How do you re-enable an element after disabling it this way? $("#foo").attr("disabled", "disabled");

Posted: Oct 11 11 at 23:08

View 3 Replies!   View Related
Jquery :: Enable & Disable A Div And Its Elements
I am looking for a method to Enable and Disable the

div id="dcalc" and Its children.
<div id="dcalc" class="nerkheArz"
style="left: 50px; top: 150px; width: 380px; height: 370px;
background: #CDF; text-align: center" >
<div class="nerkh-Arz"></div>
<div id="calc"> </div>
</div>

I want to Disable them at loading the page and then by a click i can enable them? This is what i have tried
document.getElementById("dcalc").disabled = true;

Posted: Dec 7 11 at 22:55

View 4 Replies!   View Related
JQuery :: Enable / Disable Just DIV After Radio Buttons
Using this as a simplified example, assume I have a table that has some radio buttons in it followed by a div element with a link in it. This pattern is then repeated some unknown number of times like so:

<table class="rdoBtnList">
<tbody>
<tr>
<td> Person 1 </td><td>
<label for="rb1">Verified</label>
<input type="radio" id="rb1" name="rdoBtns" value="Verified" />
<label for="rb2">Not Verified</label>
<input type="radio" id="rb2" name="rdoBtns" value="NotVerified" />
</td></tr></tbody></table>
<div class="PersonLink"><a href="#">Link to Person 1 page</a></div>
..... tables and divs for person 2, 3, ... n, etc

I would like to be able to use jQuery to enable/disable the link in the div following the radio buttons based on the value of the radio button. I can get the value of the radio buttons, but cannot figure out what selector syntax I would use to enable/disable just the div after the radio buttons.

Here is my jQuery so far:
<script type="text/javascript">
$(document).ready(function() {
$(".rdoBtnList > tbody > tr > td > input").change(function() {
if ($(this).val() == "Verified") {
// select the link in the div following the table and enable it
} else {
// select the link in the div following the table and disable it
}});
});
</script>

Posted: Feb 4 10 at 19:48

View 2 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved