473,396 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

transferring strings from php to javascript


Hi there,

i got this javascript-function that changes the entries of a selectbo
depending from the selection of another selectbox:

function changeBezug(selectedEntry, '$exhibits', .....) {}

the string '$exhibits' holds all the entries for the option Entry i
the first selectbox;
Unfortunately i get javascript error unterminated string literal an
the error pointer points at the first apostroph:
function changeBezug(selectedEntry, '

I tried replacing all special chars in $exhibits, even putting th
string directly into the function code with php and tried using quote
instead..

Now im out of ideas!
Maybe im using the wrong replacement for the apostroph...
i use ' is that wrong? i also tried ' to no good either..
what's the right one?

Could it be sth else?
Thanks
Christia

Unregistered
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message37448.htm

Jul 20 '05 #1
3 1344
In article <Gu**********@mail.forum4designers.com>,
Gu**********@mail.forum4designers.com enlightened us with...

Hi there,

i got this javascript-function that changes the entries of a selectbox
depending from the selection of another selectbox:

function changeBezug(selectedEntry, '$exhibits', .....) {}


You don't put apostrophies in the function definition. They go in the
call.

function myFunction(var1, var2)
{
var1.value=var2;
}

<script ...>
....
myFunction(selectedEntry, 'string literal');
....
</script>

--
--
~kaeli~
Never mess up an apology with an excuse.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2

yeah, of course, i copied that copied that incorrectly from my script
Its actually just as you wrote

Unregistered
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message37448.htm

Jul 20 '05 #3
In article <Gu**********@mail.forum4designers.com>,
Gu**********@mail.forum4designers.com enlightened us with...

yeah, of course, i copied that copied that incorrectly from my script.
Its actually just as you wrote.


Ah, then you must have another single quote in the string.
You can't do that.

I myself never found a good way around that and simply disallowed double
quotes in the input and used double quotes for the attribute. Single
quotes could then be used in the input with no problems.

If that was not the problem, view the source of your document and post
what the browser actually sees (no PHP code).

--
--
~kaeli~
With her marriage, she got a new name and a dress.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Paul Prescod | last post by:
I skimmed the tutorial and something alarmed me. "Strings are a powerful data type in Prothon. Unlike many languages, they can be of unlimited size (constrained only by memory size) and can hold...
2
by: Shabam | last post by:
I'm looking for a way to code two list boxes with a button in between them. When I select an item from the left list and click the ">" I want that item to move to the list box to the right...
2
by: Matthew Lybanon | last post by:
If this is not the correct newsgroup, please direct me to one better suited to my request. I have created a simple online survey (using a form) for a club. For several reasons we prefer to have...
3
by: Chris K. | last post by:
Hi, Setting my first steps into Java, managing my genealogy website. In the list of names, with the names in anchor tags, i want a popup window to appear on clicking the name. With the command...
15
by: http://www.visual-basic-data-mining.net/forum | last post by:
Does anyone have any idea how to transferring data from TextBox1 in form1 to textBox2 in form2..... That means after i fill in any data in textBox1 and click Next button... It will bring me to...
12
by: Water Cooler v2 | last post by:
Are JavaScript strings mutable? How're they implemented - 1. char arrays 2. linked lists of char arrays 3. another data structure I see that the + operator is overloaded for the string class...
7
by: esj | last post by:
let me say up front that my experience with JavaScript and "Ajax" interactions has been horrific. There are weeks I will never get back because of it. Whenever I encounter something so horrific...
6
by: comp.text.xml | last post by:
Hi, I'm developing a system uses SOAP took kit version 3. The XML is transferred between the server and the client. We have noticed when transferring data using SOAP a considerable amount of...
1
by: cloh | last post by:
I have a form in Access that generates an Excel Workbook with multiple worksheets. Each worksheet is unique to a particular location. The top row of each sheet shows the dates, the left-most column...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.