Jump to content

gearup

Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Location
    Zurich

gearup's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi, I have recently added the Google translate function to my website, it works ok but, there is a text string I display below the header image on each page ("life is good, maybe it can be better") and with some translations the text overflows the right border of my web page. What I have been trying to do is fix the right (end) position of this text string so it grows to the left where there is plenty of room and no longer overflows the web page rhs boundary. I have looked through the W3 topics and tried things without success. I think it is not a very hard task but I am not seeing what is to be done. Maybe someone else can see what to do? Here is the code section from my template index.php file, <body><div class="wrapper"><div class="header headerpic"> <div class="header headermask"> <div class="logobox"> <a title="home" href="<?php echo WB_URL; ?>/"> <img src="<?php echo TEMPLATE_DIR; ?>/img/logo.png" alt="home"/> </a> </div> <div class="headerquote"> <br/> "life is good, maybe it can be better" </div><!--End headerquote--> </div></div><!--End Header--> and the CSS, .wrapper {background: transparent url(img/wrapperbg.png) repeat-y;width:984px;min-height:100%;margin:0 auto;}.header {width:984px;height:315px;}.headerpic {background: transparent url(img/header.jpg) no-repeat 17px 35px;}.headermask {background: transparent url(img/header-mask.png) no-repeat;}/* Header Image Quote */.headerquote {padding: 1px 21px 0px 19px;width: 400px;height: 20px;font-family: "Monotype Corsiva", cursive;font-size: x-large;font-style: italic;display:inline;position:relative; top:260px;left:260px;}.logobox { float:left; margin-top:30px;} I am not advertizing this website but if you wanted to see the problem then go to,https://medsforeverybody.comand use the translate selector, for example to Bulgarian. Regards,
  2. Hi and thanks for the input, Yes, I am using a template system but the problem appears to be that I was trying to add php code into a .htm file. I had some support from a friend who suggested I should do the conditional test in the .php file where the variables are defined such as; $read_txt = ($items[$i]['item_id'] == "39") ? 'readonly="readonly"' : ''; .... 'READONLY' => $read_txt then in the .htm file use, ...<td class="mod_bakery_cart_td_quantity_f"><input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" {READONLY} value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <a href="#" onclick="javascript: mod_bakery_delete_item_f('{ITEM_ID}_{ATTRIBUTES}');"> <img src="{WB_URL}/modules/bakery/images/delete.gif" alt="{TEXT_DELETE}" title="{TEXT_DELETE}" /></a></td>... I tried this and it works. There is always something to learn with coding Regards,
  3. Hi, I am adding a product by default to each order so it will always appear in the shopping cart. What I am trying to achieve is for this product the Quantity remains set at 1 (eg read only). I have added some php to the cart body htm file and I now get 2 columns for quantity, one read only and the other is editable (I know this is an error but...). I know the ID for this product (39) but seem unable to get the conditional code to detect the ID and just set that specific one to read only. can someone please tell me what is wrong here? Here is the htm code, original, <tr><td class="mod_bakery_cart_td_thumb_f"><a href="{LINK}"><img src="{THUMB_URL}" alt="{NAME}" width="{THUMB_WIDTH}" height="{THUMB_HEIGHT}" border="0" /></a></td><td class="mod_bakery_cart_td_sku_f">{SKU}</td><td class="mod_bakery_cart_td_name_f"><span class="mod_bakery_cart_item_f">{NAME}</span><br />{ATTRIBUTE}</td><td class="mod_bakery_cart_td_quantity_f"><input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <a href="#" onclick="javascript: mod_bakery_delete_item_f('{ITEM_ID}_{ATTRIBUTES}');"> <img src="{WB_URL}/modules/bakery/images/delete.gif" alt="{TEXT_DELETE}" title="{TEXT_DELETE}" /></a></td><td class="mod_bakery_cart_td_price_f">{PRICE}</td><td class="mod_bakery_cart_td_shipping_f" style="display: {DISPLAY_SHIPPING}">{SHIPPING}</td><td class="mod_bakery_cart_td_sum_f">{TOTAL}</td></tr> and now changed by me, <tr><td class="mod_bakery_cart_td_thumb_f"><a href="{LINK}"><img src="{THUMB_URL}" alt="{NAME}" width="{THUMB_WIDTH}" height="{THUMB_HEIGHT}" border="0" /></a></td><td class="mod_bakery_cart_td_sku_f">{SKU}</td><td class="mod_bakery_cart_td_name_f"><span class="mod_bakery_cart_item_f">{NAME}</span><br />{ATTRIBUTE}</td><td class="mod_bakery_cart_td_quantity_f" id="{ITEM_ID}" $id-xx = id> <?php if $id-xx == 39): ?> <input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" readonly="readonly" value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <?php else: ?> <input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <a href="#" onclick="javascript: mod_bakery_delete_item_f('{ITEM_ID}_{ATTRIBUTES}');"> <img src="{WB_URL}/modules/bakery/images/delete.gif" alt="{TEXT_DELETE}" title="{TEXT_DELETE}" /></a> <?php endif; ?></td><td class="mod_bakery_cart_td_price_f">{PRICE}</td><td class="mod_bakery_cart_td_shipping_f" style="display: {DISPLAY_SHIPPING}">{SHIPPING}</td><td class="mod_bakery_cart_td_sum_f">{TOTAL}</td></tr> I think my problem is with passing a value into the php section but someone else may have a better idea. Regards,
  4. This is now resolved, I got help from another source and I was missing 2 loop controls.
  5. Hi, I am using websitebaker 2.8.3 CMS and this is my first time with Javascript. I have a form and want the extra info text boxes to be hidden until needed ie, when the select field=yesThis js hides them ok but will not display the fields when needed. Then for the select fields that still are on the default "Please Select" I want them to be treated as empty. The last part of the code should do this but it doesnt. I was given the code to use and have modified it. The logic looks ok to me but obviously something is wrong as it doesnt do the right thing. Firebug detects no errors. I would really appreciate a little help with this. This is a sidetrack but the only part i have no idea about in the code below is, ...onchange = function() what is "function()"? (tried searching on web for an explanation with no luck although i see it used in examples) for info: field34 = select field, field71=extra text field for itAlso: Select field values are 'Please Select','Yes','No' <tr><td> </td><td><input type="submit" name="submit" onclick="onSend()" value="{SUBMIT_FORM}" /></td></tr></table><script type="text/javascript">var selectFields = new Array('field34', 'field35', 'field36', 'field32', 'field37', 'field38', 'field41', 'field42', 'field43', 'field65');var specialFields = new Array('field71', 'field72', 'field74', 'field73', 'field75', 'field76', 'field77', 'field78', 'field79', 'field80');function hidefield(i){document.getElementById(specialFields[i]).parentNode.parentNode.setAttribute("style","visibility:collapse");}for (i = 0; i < selectFields.length; i++){hidefield(i);}for (i = 0; i < selectFields.length; i++){document.getElementById(selectFields[i]).onchange = function() { if (document.getElementById(selectFields[i]).selectedIndex == 1) { document.getElementById(specialFields[i]).parentNode.parentNode.setAttribute("style","visibility:visible"); } else { hidefield(i); } } function onSend() { if (document.getElementById(selectFields[i]).selectedIndex == 0) { document.getElementById(selectFields[i]).name = "empty"; } }}</script> After i get this working then as not all my select fields need additional information but i still want them to be validated as empty when not set by the user, such asGender Please Select/Male/Femalethen maybe for the times where there is no extra hidden field I could still use a correct value in the select array but use a known id in the special array such as 'fieldnull' (or similar) and skip hidefield processing during the loop.
  6. Javascript Problem

×
×
  • Create New...