Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-22-2006, 11:00 AM   #1 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Div Link

Could anybody point me in the right derection, on how to create a form action within as div. Is it something like

Code:
<div form action="" value="452153"> </div>
Resulting in a form being submitted once the div has been clicked on

Many Thanks,
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 08-22-2006, 11:51 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
well a form is not an attribute of a div, so i will guess your div should exist inside a form.

you can create an onclick event in your div and do what you want. since divs are not form fields, i created a hidden div and made the onclick event set the value of the hidden div before it submits the form.

HTML Code:
<form name="myform" method="POST" action="somescript.php">
<input type="hidden" id="myhiddenfield">

<div onclick="document.getElementById('myhiddenfield').value='452153'; document.forms['myform'].submit();"></div>
</form>
it's my best guess to what you are trying to do.
__________________
Mike
sde is online now   Reply With Quote
Old 08-22-2006, 12:11 PM   #3 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Div Link

is there any way of doing the same think through a normal link. For example on text?

Many Thanks,
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 08-22-2006, 04:27 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
well you need some dom element to attach the onclick event to, so i suppose a span tag might work. try replacing the div with a span.
__________________
Mike
sde is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hide target link rivers9 HTML, XML, Javascript, AJAX 8 08-25-2005 12:05 PM
copy a directory link with -Rs sde Linux / BSD / OS X 3 02-15-2005 05:34 PM


All times are GMT -8. The time now is 10:52 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting