Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use an anchor tag to submit a form? 2

Status
Not open for further replies.

globularbob

Programmer
Nov 15, 2002
69
US
Is there a way to invoke a sub procedure to submit a form by using the HREF of an anchor tag? I'm hoping to submit a form using a graphic.
 
Code:
<script >
function sendmyform()
{
window.location &quot;[URL unfurl="true"]http://your_web.com/Dir/page1.asp?T1=&quot;[/URL] + form1.T1.value ;
}

</script>
<form name=&quot;form1&quot;>
<input type=&quot;text&quot; name=&quot;T1&quot; value=&quot;&quot;><br>
<a href=&quot;&quot; onclick=&quot;javascript:sendmyform()&quot;><img src=&quot;folder/img_file.jpg&quot;></a>

</form>

*JJ* [flowerface]
 
Any idea how to delete a user's file from their folder after the user click the graphic &quot;Delete&quot; that I create? Can this be done without a form?

Or how would I do using a form? First, user needs to see their files uploaded on my server, then, once they click something, the particular file should be deleted. I've no idea.

 
You will need to use the FileSysteomObject to reference the file, this way you can show the date last modified for the file (which should be within a few minutes of current time since they just created it). Then you can delete the file using the same file object, here is the file reference from w3schools, shows getting date last modified and the delete method:

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
JJ26... have you tried this....

<script >
function sendmyform(){

document.form1.action = &quot;formHandler.asp&quot;
document.form1.method = &quot;post&quot;
document.form1.submit()

}

</script>
<form name=&quot;form1&quot;>
<input type=&quot;text&quot; name=&quot;T1&quot; value=&quot;&quot;><br>
<a href=&quot;&quot; onclick=&quot;javascript:sendmyform()&quot;><img src=&quot;folder/img_file.jpg&quot;></a>

</form>
-- Just trying to help...
[wolf]<--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
 
thanks for another input , Wolf.
i keep that for consideration in my ASP application.

the icon is more refered to dog, not wolf.
find another icon.

*JJ* [flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top