/    Sign up×
Community /Pin to ProfileBookmark

When using this code

<script language=”javascript”>

function addSeat(value)
{
var list = document.form1.list1.value;
if (list) {value = “,” + value;}
document.form1.list1.value = list + value;
}

function stage1booking()
{
tmpArray as new Array(100)
var seatString as string
var seatValues = document.form1.list1.value;
tmpArray = seatStatus.split(,);
}
</script>

I keep getting Error at line 27: ; expected

Am I been completely stupid somewhere because no matter what I change I always get the error

Regards

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@sciguyryanJan 17.2005 — Unlike some languages you do not have to do a type designation for Javascript, so this is wrong:

<i>
</i>&lt;script language="javascript"&gt;

function addSeat(value)
{
var list = document.form1.list1.value;
if (list) {value = "," + value;}
document.form1.list1.value = list + value;
}

function stage1booking()
{
tmpArray as new Array(100)
var seatString as string
var seatValues = document.form1.list1.value;
tmpArray = seatStatus.split(,);
}
&lt;/script&gt;


And should be:

<i>
</i>&lt;script language="javascript"&gt;
&lt;!--
function addSeat(value){
var list = document.form1.list1.value;
if (list){
value = "," + value;
}
document.form1.list1.value = list + value;
}
function stage1booking(){
var tmpArray = new Array(100);
var seatString = "";
var seatValues = document.form1.list1.value;
tmpArray = seatStatus.split(","); // #1
}
//--&gt;
&lt;/script&gt;


Try and see if that works.

You'll also have to work something else out, (Look for // #1), that line needs to add values to an array I presume so, you'll have to use a loop to put each component of it in there, I suggest a [i]while[/i] loop.

RyanJ
Copy linkTweet thisAlerts:
@webBeginnerauthorJan 17.2005 — Ah ok, many thanks
Copy linkTweet thisAlerts:
@sciguyryanJan 18.2005 — Your welcome.


RyanJ
×

Success!

Help @webBeginner spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.10,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...