473,397 Members | 2,068 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,397 software developers and data experts.

Passing an alphanumeric string value to a javascript function in js file

Hi,

A js file containing a function which is passing an alphanumeric string to another function in the same file, the second funtion requires 4 parameters to pass from the first function.
The first three are the number and the last one is the alphanumeric string , but when I apply the fourth parameter , it throws out an error Expected';'

The value in the varval parameter are like '2 xyz', '4 abc'

The calling fucntion is being called link this
Expand|Select|Wrap|Line Numbers
  1. func1 {
  2. .......
  3. document.getElementById('inlineEdit_'+recid).innerHTML += '<a onClick="cancelEdit('+recid+','+ count_sqlChangeSet+','+currpage+','+varval+')" class="revertEditing" title="Cancel" id="revert"><img src="http://bytes.com/images/cancel.gif" border="0" /></a>'
  4. ...... }
  5.  
Under is the called function

Expand|Select|Wrap|Line Numbers
  1. function cancelEdit(recid,count_sqlChangeSet,currpage,changeSetNo)
  2. { //changeSetNo = '2 xyz';
  3.         alert(changeSetNo);
  4.  
  5.     document.getElementById('inlineEdit_'+recid).innerHTML = '<a onclick="inlineedit('+recid+','+ count_sqlChangeSet+','+currpage+')" >Inline Edit</a>'
  6.     document.getElementById('changeSetNo_'+recid).innerText = changeSetNo;
  7. }
  8.  
Please help..

Shalabh
Aug 28 '09 #1
1 4838
gits
5,390 Expert Mod 4TB
you need to concat the corresponding qoutes to the link where you build the call ... since the params needs to be passed as strings ...

kind regards
Aug 28 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
4
by: Matt | last post by:
I posted this problem before but no reply. Now I repost again. I want to compare the address number in javascript, and the address number is alphanumeric. I have a text box and the user needs to...
4
by: Matt | last post by:
I want the javascript to test an alphanumeric (a string contains alphabet or numbers only) string. Should I write a regular expression? What's the best way to do? please help. thanks
6
by: Matt | last post by:
I want to check if the user enters alphabet or numbers only in the text box. If the user enters non-alphabet or non-numbers, I should pop up a message and doesn't allow the user to do that. I am...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
5
by: sfeher | last post by:
Hi All, I need to call a function(loaded with appendChild) for which I have the name as a string. .... var fnName = 'fn1'; var call = fnName + '('+ param +' )'; eval(call);
4
by: Nathan Sokalski | last post by:
I am a beginner with AJAX, and have managed to learn how to use it when passing single parameters, but I want to return more than one value to the client-side JavaScript function that displays it....
5
by: moni | last post by:
Hi.. I am trying to use javascript for google maps display. If I call the javascript function from my aspx file I use: <input type="text" id="addresstext" value="Huntington Avenue,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.