|
-
Oct 12th, 2000, 02:51 PM
#1
Thread Starter
Lively Member
With this code i submit my name and nickname to
an ASP page.
Code:
<Form Method="post" Name="Form1" Action="Second.asp">
<Input Type="Text" Size="26" Name="Name">
<Input Type="Text" Size="26" Name="Nickname">
<Input Type="submit" Value="Submit" Name="Go">
</Form>
But i want to replace the submit button by a image, how
do i do that. And i want it to work on both Netscape and
Explorer.
Thanks!
If possible please provide codes.
Process by example is the best way to learn.
-
Oct 12th, 2000, 07:48 PM
#2
Frenzied Member
Code:
<%@ Language=VBScript %>
<%
If Request.Form("Name").Count > 0 Then
Response.Write Request.Form("Name") & " - " & Request.Form("Nickname") & "<BR>"
End If
%>
<HTML>
<HEAD>
<SCRIPT language=javascript>
function submitme(){
Form1.submit();
}
</SCRIPT>
</HEAD>
<BODY>
<Form Method="post" id=Form1 Action="_Test2.asp">
<Input Type="Text" Size="26" Name="Name">
<Input Type="Text" Size="26" Name="Nickname">
<img SRC="Images/ie4get_animated.gif" WIDTH="88" HEIGHT="31" BORDER="0" usemap=#submitmap>
</Form>
<MAP name=submitmap>
<AREA shape="rect" coords="0,0,88,31" onclick="submitme()">
</MAP>
</BODY>
</HTML>
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Oct 13th, 2000, 02:44 AM
#3
Frenzied Member
This works with Netscape and IE
(change file names to suit your needs)
Code:
<head>
</head>
<body bgcolor="50D0FF">
<Form Method="post" Name="Form1" Action="/scratch/some.asp">
<Input Type="Text" Size="26" Name="Name">
<Input Type="Text" Size="26" Name="Nickname">
</Form>
<A href="javascript:document.Form1.submit()"><img src="./wallpaper/100.jpg"></A>
</body>
</html>
-
Oct 17th, 2000, 10:50 AM
#4
Thread Starter
Lively Member
Can we work with flash to
Thanks i'm gonna try both.
By the way i'va another question on a similar topic.
Can it be done using a flash Button without having
to pass every variable direclty into flash coz it's
a bit tricky when you have many different variable.
So now it's not basics anymore.
But maybe someone knows how to do it.
If possible please provide codes.
Process by example is the best way to learn.
-
Oct 18th, 2000, 12:40 PM
#5
Thread Starter
Lively Member
Javascript submit() ?
I have try to replace a submit button with an image an a
javascript, but i need to pass a variable too just like
a button.
So i have have a form with two button [Add] & [Modify]
Code:
<Form Method="post" Name="Form1" Action="Second.asp">
<select name="menu1">
<option selected>1</option>
<option>2</option>
<option>3</option>
</select>
<input type=submit name=Action value=Add>
<input type=submit name=Action value=Modif>
</Form>
In Second.asp
I'm trapping wich button have been click with the variable
Request.Form("Action").
But when i use this
Code:
<A href="javascript:document.Form1.submit()">Image Add<A>
<A href="javascript:document.Form1.submit()">Image2 Modify<A>
Instead of a button i can't submit the variable. Is there
a way to add that. Or is it impossible, it still have to
be compatible IE and Netscape.
Thanks anyway! You've helpe me a lot already.
If possible please provide codes.
Process by example is the best way to learn.
-
Oct 19th, 2000, 02:35 AM
#6
Frenzied Member
Try this:
I've put the 2 buttons on a separate form so they don't appear in the request string.
Buttons have to be on a form for them to work in netscape
(IE doesn't care)
Also, I would avoid using methods and properties etc for names of controls.
you had buttons called "Action"
This is asking for trouble because Form1.Action is "second.asp" !
Code:
<HTML>
<HEAD>
<script language=javascript>
function doIt(opt)
{
document.Form1.Act.value=opt;
document.Form1.submit();
}
</script>
</HEAD>
<BODY>
<Form Method="post" Name="Form1" Action="Second.asp">
<select name="menu1">
<option selected>1</option>
<option>2</option>
<option>3</option>
</select>
<input type=hidden name=Act>
</Form>
<form name=frm2>
<input type=button value="Add" onClick="doIt(this.value)">
<input type=button value="Modify" onClick="doIt(this.value)">
</Form>
</BODY>
</HTML>
-
Oct 19th, 2000, 08:05 AM
#7
Thread Starter
Lively Member
Thanks for everyone
I've found a way to do it with many images button
with javascript. And it works fine.
To those who want to know how, e-mail me at [email protected]
If possible please provide codes.
Process by example is the best way to learn.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|