Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

javascript code help


moyashi

Recommended Posts

ok, since there is "no" specific forum ... I guess this goes here.

 

I need some javascript help.

 

I'm trying to get a form to process off mulitple languages.

 

function setstext_1_s(text) {

if (document.new_product.newsdesk_article_shorttext[1].createTextRange && document.new_product.newsdesk_article_shorttext[1].caretPos) {

 var caretPos = document.new_product.newsdesk_article_shorttext[1].caretPos;

 caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?

 text + ' ' : text;

}

else document.new_product.newsdesk_article_shorttext[1].value += text;

document.new_product.newsdesk_article_shorttext[1].focus(caretPos)

}

 

Which is the function

 

echo newsdesk_draw_textarea_field('newsdesk_article_shorttext[' . $languages[$i]['id'] . ']', 'soft', '50', '3', (($newsdesk_article_shorttext[$languages[$i]['id']]) ? stripslashes($newsdesk_article_shorttext[$languages[$i]['id']]) : newsdesk_get_newsdesk_article_shorttext($pInfo->newsdesk_id, $languages[$i]['id']))

);

 

Is the form code.

 

 

The problem is that I'm pretty sure [1] isn't legal for javascript, so I changed it to "_1" which works but then doh, goto preview and of course osC is looking for "[1]"

 

I setup the javascript function file to work for "4" codes. A bit troublesome but works. What is more of a hassle is the working around the osC code. Any body out there with any ideas or hints?

 

heck, even a link to a difinitive javascript site would be nice too. I'm not doing to well on google searching lately ... :cry:

NewsDesk(934) / FAQDesk(1106) / OrderCheck(1168) :::

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...