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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submitting varying form data with one link

Status
Not open for further replies.

chrismassey

Programmer
Aug 24, 2007
264
GB
I am currently improving on a Webspace Explorer system written in PHP which inevitably incorporates HTML/CSS and javascript.

My main issue at the moment is that I need to be able to see which files have been selected to perform an action on them. This would be simple if I were to use a normal form. However, the way it is laid out would mean that I would have to use forms within forms which I don't think is possible.

Therefore I would like to be able to submit data using a link. However I believe this would mean that I would have to dynamically change the URL of the link submitting the data.

E.g. the initial link would be
And when a checkbox is selected, the url dynamically changes to
Or if 2 are selected

etc

Is this possible to do?

Thanks alot,

Chris
 
OK...
...I need to be able to see which files have been selected...
Does this mean there is a form with a list of inputs of type "file"?

I understand you don't want to submit the data using the form, and that you want to submit some data nonetheless. A successful pattern is to use javascript to query the data and build up a string of the format:
"?key1=value1&key2=value2"

That string can then be used for an XHTTP request - so the content is sent to the back-end without forcing the page to reload.

If I've assumed too much, you'll have to supply some more details... and maybe some code!

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Thanks for your response Jeff,

This is for a future project and this aspect was on my mind at the time. At the moment, other versions of the program are sufficient and I am working on them before designing the next version which will incorporate my issue above.

Really I need to try a couple of things out before I come across a definitive problem regading the above issue.

Once i'm ready ill post my code if I have a problem

Thanks alot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top