i have an form in which i have radiolist and set of text boxes and dropdownlist.now when i check an radio some textboxes will be disabled and some text box will be enabled .now i want to validate only the enabled text box and not the disabled one.
in the same manner when i check other radiobutton i want to validate the rest of the text boxes.can some body help please.
some one give me the validation code for that.
If you can use jQuery then you can get the enabled text boxes using
$("input[type='text']:disabled")
and the enabled text boxes using
$("input[type='text']:not(:disabled))
If you want to use simple javascript then you can get all the textboxes, then iterate through them, check the type attribute for text and check the disabled attribute to true or false.
Related
I know this is a low level question, but I am "annoyed" that on my forms which are for read only purposes, i cannot figure out how to remove the drop down Arrow box on fields which are linked to a list of records..
Does anyone know if this can be done??
If you have a Lookup Field in Access and in the Design View of a form you drag it from the field list onto a form you'll get a Combo Box control. Combo Boxes have the little drop-down arrow tacked onto the end.
To get rid of the drop-down arrow simply replace the Combo Box control with a Text Box control. That is, create a Text Box control on the form and set its Control Source property to the name of the lookup field, then delete the Combo Box control. The Text Box control will display the selected value(s) of the lookup field but will not allow you to edit them.
There is an easier method than Gord Thompson's. This is in Access 2010 and may be applicable to other versions. In either Design or Layout View, right click on the combo box control and go to "Change To" then select text box.
I am trying to implement Facebook autocomplete functionality after a user types # for a multiline ASP.Net textbox, including highlighting the selected text (this would only be a part of text inside the textbox).
My question is: is it possible to apply different styles inside a textbox or how does Facebook highlight in blue what the user choose from the completion list? How can I achieve the same result with my textbox? As far as I know one cannot apply different css inside the same textbox.
Please help & encourage me.
is it possible to apply different styles inside a textbox
No.
or how does Facebook highlight in blue what the user choose from the completion list?
contentEditable is your keyword. This is a mechanism implemented in newer browsers to make parts of a document “editable”; and with HTML5 is has gotten standardized.
DevExpress AspXGrid has a cool editform template that you can use it several ui style as popup form or inline form betwwen grid rows etc..
When you unimplement Update Event of grid and if you allow grid to editing from settings, it shows the EditForm, but when you fire update button at this state, it shows a cool Error Message like "Specified method is not supported"..
I want to write some custom message in the same place of that message.
Anyone knows how can i do?
Thanks a lot.
Use the ASPxDataValidationEventArgs.RowError property to specify the error text displayed within the Error Row. This row is automatically displayed below the Edit Form if the RowError property is set to a not empty string.
Please, also take a look at the GridEditing/Validation demo module and ASPxGridView documentation.
I have a custom TextInput that listens for the FocusEvent.FOCUS_IN and FocusEvent.FOCUS_OUT events:
textDisplay.addEventListener(FocusEvent.FOCUS_IN, onFocusInHandler);
textDisplay.addEventListener(FocusEvent.FOCUS_OUT, onFocusOutHandler);
My onFocusInHandler function basically removes a "promptview" that tells the user to type in a value, with the onFocusOutHandler doing the opposite.
For example, if the TextInput text was backspaced to a blank value and the user clicks out of the TextInput box, it would show a "Please enter a value" light-gray prompt in the TextInput.
This works fine until the user clicks our custom "Clear" button. The clear button sets the text to "", and I can tell the FocusEvent.FOCUS_OUT is received because the prompt text is set to visible (its not being set anywhere else). The problem is, the cursor remains in the box as if it still has focus, so if the user immediately starts typing, both the prompt text "Please enter a value" and the user-entered text appears over the gray text, which looks pretty ugly and unreadable.
Why does the TextInput receive the FocusEvent.FOCUS_OUT event if it's not actually losing focus? Is there any way I can get around this?
Option 1. Use the Spak TextInput in Flex 4.1 or 4.5. This already provides a promptDisplay by default (as mentioned in the comments)
Option 2. Take a look at the focus-skin. This skin class is usually placed on top of the normal skin. There could exist some focus ambiguity between these two. Try using a custom focus-skin without a textDisplay and clear button.
Option 3. Not only use a focus event to show or hide the prompt, but also look at the content of the TextInput. You don't want to display a prompt when the text is set by binding as wel.
How to remove a textbox and put the dropdown box in asp.net
And the value that is used before in textbox, now it should take from dropdown box
You can use select tag for this. And can get the selected value in C# using the following code
Suppose cmb is the id of your dropdown box, then
cmb.Items[ cmb.SelectedIndex ].Value
can fetch the value selected in your drop down box and
cmb.Items[ cmb.SelectedIndex ].Text
can fetch the text selected
easiest way is to use jquery and jquery.jeditable plugin with it.