attributes

Are single/double quotes allowed inside HTML attribute values ?

I'm trying to set attribute value that contains a single quote: var attr_value = "It's not working"; var html = "<label my_attr='" + attr_value + "'>Text</label>"; $('body').html(html); However, I get the following result: <label working="" not="" s="" my_attr="It">Text</label> How could I fix this ? Are double quotes allowed insi...

TypeDescriptor.AddAttributes() replaces the current attribute insead of adding it

I have this portion of code: var hasAttribute = TypeDescriptor.GetAttributes(property.DeclaringType).OfType<CrmTypeAttribute>() .Any((attr) => ((CrmTypeAttribute)attr).Name == property.Name); if (!hasAttribute) { var crmTypeAttribute = new CrmTypeAttribute(proper...

asp.net c# asp:TextBox, How to remove the cols and rows attributes?

i have a asp:TextBox control on the page. i'm setting it to a TextMode="MultiLine", I am not setting a number of rows or columns. I am setting a width and height in CSS for the control. asp.net is still adding, what i assume is a default, rows and cols attributes on the rendered control. cols="20" and rows="2" this isnt an issue in any ...

XML parser-writer that keeps Attributes order.

I need to parse XML document and then write every node to separate files keeping exact order of attributes. So if i have input file like : <item a="a" b="b" c="c"/> <item a="a1" b="b2" c="c3"/> Output should be 2 files with every item. Now if xml.dom.minidom is used - attribute order is changed in output( i can get - <item b="b" c="...

Get each Attribute of element in loop function

I have a HTML DIV element: <div class="obj" height="this is attr 1" rel="this is att2" width="this is att3"></div> I've a new Variable: attArray: var attArray = new Array(); I want to get step by step each att in div.obj into attArray. How do I do it? attArray[0] = "this is attr1" attArray[1] = "this is attr2" attArray[2] = "this ...

How do I modify the Magento Order Slip to show a custom product attribute?

I need to display an additonal custom attribute from a product on the Order Slip PDF so that our distributor can find the proper product id. We have 3 different types of SKUs being used; one is our own, the other is from our supplier and another is from the manufacturer. Which part of Magento do I have to change in order to add the cust...

Adding values to a magento dropdown or multi-select product attribute while adding a new product

I'm wondering if anyone has found or written an extension that would allow a magento website administrator the ability to add values to their products attribute while adding the product. For example, if I sell books and want the book author to be in a drop down list so that it would be used in layered navigation, it seems odd that I wou...

Dynamically change the attribute of property

i have one class contact in "Contact.DLL" which has 10 properties , properties has attributes (like IsDisplayed), now in different assembly"custom grid" , i am creating an form , where we query each attribute of class and display them in form. now i have to hide some attributes based on "isneeded" property of contact object, if isneede...

Enum Intellisense Display Attribute??

I want to do this: enum Foo { [Display="Item One"] ItemOne, } So that Intellisense will display it like in the attribute instead of the actual name. I know it's possible, I've seen it before. ...

javascript/jQuery: how do you dynamically turn attribute values into object keys?

Here is my problem, I have a whole bunch of elements that look like this... <input type="email" id="email" data-item="email" data-key="contact_details"/> <input type="tel" id="mobileNo" data-item="mobileNo" data-key="contact_details"/> <input type="text" id="sleeve_length" data-item="sleeve_length" data-key="measurements"/> <input type...

Adding readonly attribute to all form elements

I'm using jQuery to add a readonly attribute to all form elements but can't seem to figure out how to do this. Here is what I'm trying: $('#form1').each( function() { $(this).attr('readonly', true); }); I have a simple form using label/input to display form elements. Also I'm using tipsy (Tool tip plug-in) as well as Formalize (Look ...

Moving an id from cell to relative cell in a table using jQuery.

I want to "move" an id from one cell in a table to a relative cell in the table. To simplify things, let's say I have this: <tr><td></td><td id='a'></td><td></td><td></td><td></td></tr> One of the cells has id='a' but I don't know which it will be. I simply want to make the one to the right of it have id='a'. Getting the cell with i...

XSLT to copy XML doc and add attribute plus generated value under certain conditions

Hi, I'm pretty new to XSLT and have an urgent work requirement that I'm finding quite complex to sort out. I have an XML doc which needs an attribute adding under certain conditions. The XML doc is pretty straightforward: <A x="foo" y="bar" z=""> <B/> <C/></A> Basically if attribute "z" is present. Then a new attribute needs to be...

Show ubercart attribute only if other attribute is checked

If you have a set of attributes that should only be available to a product (shown to the user and then selectable), if a certain other attribute is checked, how would one accomplish this? Andrew ...

Tell C# to use Castle to create objects

Hi! I think my question is a long shot. Lets say I have an attribute: public sealed class MyCustomAttribute: ActionFilterAttribute Used on a class method [MyCustomAttribute] public virtual ActionResult Options(FormCollection collection) Now, I need to add a contructor's parameter public MyCustomAttribute(IMyDependent...

jquery - update href based on select value?

I'm trying to assemble an href tag based on values a user selects from a select menu. This is the code I have, which isn't working. I'm pretty new to jQuery, so, if someone can help me out or suggest a better way, that'd be great... $(document).ready(function() { if($('#addtocalendar-selects').length) { $("select.addCalselect")...