Hidden forms and submission by link

This is a discussion on "Hidden forms and submission by link" within the JavaScript Forum section. This forum, and the thread "Hidden forms and submission by link are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 21st, 2003, 16:56
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Hidden forms and submission by link

I've got a page that is a list of items in my database. When a user clicks on an item, I need it to go to another page. However, I need to pass several peices of information (and I want to post, not get)

So, I imagine that I could have a hidden form with the framework for the values, but how do I make this happen?

I don't know enough javascript to know how this would work.

click link,
change values in form,
submit form

I'm sure this is very easy, but I couldn't find it when I searched for it.

Thanks
jakyra

  #2 (permalink)  
Old Nov 21st, 2003, 19:02
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
In the link you want to either use:
HREF="javascript:somefunction(5)"
or
HREF="#" onclick="somefunction(5)"
where the 5 would be the data specific to that link. The second format doesn't show the function name in the status bar of the window.

Then in you function you'd set the hidden form values using
formname.fieldname.value = "whatever";

finally, when you're ready to submit the form you'd call
formname.submit();

you can also change where the form submits to and what window it opens in using:
formname.action = "someURL"
and
formname.target = "_blank"
so if you wanted to change which page the data is passed to depending on something in the current page you can do that by changing the action in your function.
  #3 (permalink)  
Old Nov 21st, 2003, 19:05
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Sweet!

Thank you!

jakyra
  #4 (permalink)  
Old Nov 21st, 2003, 19:07
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
I would completly avoid this and anything else that is so completly javascript dependant.

Just my $0.02
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #5 (permalink)  
Old Nov 21st, 2003, 19:19
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
So what woudl you do instead?

jakyra
  #6 (permalink)  
Old Nov 21st, 2003, 19:39
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Dunno... as I dont know what you are doing, it would be hard for me to say.

Can you give me an example of what it is you are doing, and what the aim is?
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #7 (permalink)  
Old Nov 21st, 2003, 19:50
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
I work with books and reviews of said books. We have people who edit the reviews of the books. (Hey, I work at an educational institution.)

I need a way for my editors to see what books need to be edited, and a way for them to get to the page to review the books. I'd rather not use buttons. They're clunky for an entire page of stuff. I want them to click on the ISBN. However, I've set up the review page to serve multiple functions, so I need to send not just the ISBN (which I would be fine with having in the get string) but some state as well.

I don't want these to go through the get string because I don't want them to be bookmarkable. (or accessable from "history"

So what I want, is a way to click on a link and get information to another page via the post method.


jakyra
  #8 (permalink)  
Old Nov 21st, 2003, 19:55
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Why cant you store 'state' in session variables or cookies?

That is after all what they are for!
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #9 (permalink)  
Old Nov 21st, 2003, 20:02
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
uhhh
uhhh

Because I'm a braindead flunky and it's Friday?

doh!

*blush*

thanks
jakyra
  #10 (permalink)  
Old Nov 25th, 2003, 18:14
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
ok. I started working on this and this is my problem.

The problem with this is that I can't always set the state variable on a page level. On some pages it would depend on which link you clicked.

For example, if you click on one you would edit the book, and another you would say you don't want to review this book anymore.

So I can't set the state variable until after the link has been clicked.

any other ideas?

jakyra
  #11 (permalink)  
Old Nov 25th, 2003, 18:31
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
I posted some javascript stuff above on modifying form posts with functions called from links that might help.
  #12 (permalink)  
Old Nov 25th, 2003, 21:36
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
ahh yes.

I meant to ask in the same post. Is it possible to change the value of a field passed in as a variable?

I don't know how to say this... The field that I want to change the value on changes depending on what I'm doing, but I don't want to write a different script for each one...

thanks
jakyra
  #13 (permalink)  
Old Nov 25th, 2003, 21:56
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Possible? Yes. How? I'd need a clearer example of what you're doing to say.
Closed Thread

Tags
hidden, forms, submission, link

Thread Tools

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
Assigning a value to Hidden Type. thanawala84 Web Page Design 1 Oct 13th, 2007 08:10
hidden text Lchad Webforumz Cafe 30 Jan 5th, 2007 09:12
send mail php with external hidden link?? lsatdown PHP Forum 0 Nov 28th, 2006 10:48
Hidden Fields tomd1985 Web Page Design 2 Feb 7th, 2006 20:07
Free Submission - Require No reciprocal Link Shaw Link Building and Link Sales 0 Nov 17th, 2005 08:11


All times are GMT. The time now is 00:00.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43