If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
MM5.5 I need to limit the characters in the text box in product attributes for engraving purposes. Does anyone know if it can be done. I would like to limit it depending on the size selected.
George
It most likely is something that you would add to your PAGE > PROD > product attribute template, or to your product template manager. You may need to surround it with conditionals.
max attribute is for html5, maxlength attribute is for html4.
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
I got it to work. I went into Pages - Product Display and then under tab Product Attribute Template.
I added the bold info below. Which is good but now I have to figure out how to switch it to different lengths when different attributes are selected.
<mvt:if expr="l.settings:attribute:type EQ 'text'">
<td align="left" valign="top">
<mvt:item name="fonts" param="body_font">
<input type="text" size="20" maxlength="14" name="Product_Attributes[&mvt:attribute:index;]:value" value="&mvte:attribute:value;">
</mvt:item>
</td>
If the checkboxes are mutually exclusive then it should be a radio or select input.
If the checkboxes have separate text inputs then you would have to give the text inputs separate id's.
If you have problems dynamically generating id's and maxlength arguments, then you may need to use an option's weight field in the product > edit > attribute tab > option > weight line.
I have 8 checkboxes, checking any 4 of the eight would respresent one size and the other 4 would respresent the the other for engraving. This is on 200+ products but with one attribute template. I could have used radio buttons but I chose checkboxes instead.
One would allow 14 characters for engraving and the other 12.
GRM
yea, i was going to ask...how can check boxes have a "length"....what you really are asking here is how can i control HOW MANY checkboxes are selected. (search on javascriptsource.com...probably have something there...i try to avoid javascript<g>)
No, when a customer checks a checkbox, they are choosing size and type. They then has an option for engraving which is limited by what they checked. Some checkboxes would give the option for 14 characters of engraving and others would be 12 characters for engraving. So what I was looking for is when a customer would choose large, they would be able to put in 14 characters or if they chose small it would limit them to 12 characters.
GRM
Comment