T
Trevor L.
I posted this under another thread but I think it was lost as the answers
related to an earlier query
I have this code
<input type="button" value="1" onClick="chgImg('1')">
<input type="button" value="2" onClick="chgImg('2')">
<input type="button" value="3" onClick="chgImg('3')">
<input type="button" value="4" onClick="chgImg('4')">
There are about 60 such buttons (although I do generate then via JS so I
don't have to type the code for each one)
I would prefer to have a text box
Enter Number
|-------------|
|-------------|
Then the number in the box is placed into the function chgImg
Here is some code modified from some on w3schools
<form action="xxx.html" method="get">
Enter Number:
<input type="text" name="number" value=" ">
<br>
<input type="submit" value="Submit">
</form>
Apparently this calls xxx.html with parameter "number" set to what was typed
in, whereas I want to call a function
I tried altering the form tag to
<form action="chgImg(number)">
But it tried to open a file chgImg(number).
Can I do what I want or do I have to set up a file which then calls chgImg?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
related to an earlier query
I have this code
<input type="button" value="1" onClick="chgImg('1')">
<input type="button" value="2" onClick="chgImg('2')">
<input type="button" value="3" onClick="chgImg('3')">
<input type="button" value="4" onClick="chgImg('4')">
There are about 60 such buttons (although I do generate then via JS so I
don't have to type the code for each one)
I would prefer to have a text box
Enter Number
|-------------|
|-------------|
Then the number in the box is placed into the function chgImg
Here is some code modified from some on w3schools
<form action="xxx.html" method="get">
Enter Number:
<input type="text" name="number" value=" ">
<br>
<input type="submit" value="Submit">
</form>
Apparently this calls xxx.html with parameter "number" set to what was typed
in, whereas I want to call a function
I tried altering the form tag to
<form action="chgImg(number)">
But it tried to open a file chgImg(number).
Can I do what I want or do I have to set up a file which then calls chgImg?
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html