Link Submit Ideas

M

Mica Cooper

Hi,

I need to pass some info in a javascript submit.

<a href="javascript:document.formName.submit();">Submit Form</a>

Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1, x2,
x3. I have no clue how to do this with a link submit.

Thanks,
Mica
PS. Please no comments about the link submit, a button will not work as it
needs to be multi-dim'd and dynamic.
 
R

Randy Webb

Mica Cooper said the following on 6/29/2006 9:55 PM:
Hi,

I need to pass some info in a javascript submit.

No, you just think you do.
<a href="javascript:document.formName.submit();">Submit Form</a>

Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1, x2,
x3. I have no clue how to do this with a link submit.

Not sure why you think you need a "link submit", just submit the form.
PS. Please no comments about the link submit, a button will not work as it
needs to be multi-dim'd and dynamic.

What makes you think that a link is "more dynamic" than a button? It isn't.

What makes you think that a button isn't "multi-dim'd"? It is.

This is Usenet. You post a thought, it gets commented on. Don't want it
commented on, don't post it.
 
D

Dag Sunde

Randy said:
Mica Cooper said the following on 6/29/2006 9:55 PM:

No, you just think you do.




Not sure why you think you need a "link submit", just submit the form.


What makes you think that a link is "more dynamic" than a button? It
isn't.
What makes you think that a button isn't "multi-dim'd"? It is.

This is Usenet. You post a thought, it gets commented on. Don't want
it commented on, don't post it.

What Randy forgot to tell you, is that your submit link will
automatically do exactly what you want as long as the form 'formName'
have its method attribute set to 'get'. x1, x2 & x3 will be sendt.

BUT! You should drop that abnomination 'javascript:' pseudo-protocol.
What if your clients have JS turned off? Change it to something like this:
<a href="NeedJsInfo.html" onclick="document.formName.submit(); return
false;">
Submit Form
</a>
 
B

Bart Van der Donck

Mica said:
I need to pass some info in a javascript submit.

<a href="javascript:document.formName.submit();">Submit Form</a>

Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1, x2,
x3. I have no clue how to do this with a link submit.

Thanks,
Mica
PS. Please no comments about the link submit, a button will not work as it
needs to be multi-dim'd and dynamic.

I think you're looking for hidden form fields, try:

<form method="get" action="http://www.google.com/" name="formName">
<input type="hidden" name="x1" value="1">
<input type="hidden" name="x2" value="2">
<input type="hidden" name="x3" value="3">
</form>
<a href="javascript:document.formName.submit();">Submit Form</a>
 
M

Mica Cooper

Totally useless.

Randy Webb said:
Mica Cooper said the following on 6/29/2006 9:55 PM:

No, you just think you do.




Not sure why you think you need a "link submit", just submit the form.


What makes you think that a link is "more dynamic" than a button? It
isn't.

What makes you think that a button isn't "multi-dim'd"? It is.

This is Usenet. You post a thought, it gets commented on. Don't want it
commented on, don't post it.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/
 
M

Mica Cooper

Dag,

I need to cause a form to submit and I need many links such as

234 Anaheim CA click_link_to_submit moredata
353 Anaheim MO click_link_to_submit moredata
767 Anaheim NJ click_link_to_submit moredata
345 Anaheim NY click_link_to_submit moredata
565 Anaheim BC click_link_to_submit moredata
564 Anaheim WA click_link_to_submit moredata

Each line has user entered data that needs to be submitted and captured
therefore the submit. I would just use a normal link but I need the user
entered data on OTHER lines to be captured also so I can later restore the
state of the page.

Mica
PS. This is a corporate subscription site so all users are required to have
JS on so no problems for non-JS.
 
R

Randy Webb

Mica Cooper said the following on 6/30/2006 8:52 AM:
Totally useless.

What's useless is your inability to read and comprehend what is written.
And just for you, the solution to your question is in my post and the
reply to it, if you can manage to read and understand it.

Based on your replies, I doubt you will.

Make your "links" a submit button. Search the archives on how to use
different submit buttons and the purpose of it.

Then, change your method to "post" and the URL will be as you want. It
will submit the data. You will find out that it is easier to use a GET
though.

If you want some kind of coded data sent to the server, that is obtuse
and insane if the only purpose is to be able to "recreate the page" as
it existed.

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
 
R

Randy Webb

Mica Cooper said the following on 6/30/2006 8:58 AM:
PS. This is a corporate subscription site so all users are required to have
JS on so no problems for non-JS.

Corporate subscription site where the site author has no understanding
of forms, form submission, client side technology, server side
technology. Wow, I am impressed.
 
D

Dag Sunde

Mica said:
Dag,

I need to cause a form to submit and I need many links such as

234 Anaheim CA click_link_to_submit moredata
353 Anaheim MO click_link_to_submit moredata
767 Anaheim NJ click_link_to_submit moredata
345 Anaheim NY click_link_to_submit moredata
565 Anaheim BC click_link_to_submit moredata
564 Anaheim WA click_link_to_submit moredata

Each line has user entered data that needs to be submitted and
captured therefore the submit. I would just use a normal link but I
need the user entered data on OTHER lines to be captured also so I
can later restore the state of the page.

Mica
PS. This is a corporate subscription site so all users are required
to have JS on so no problems for non-JS.

Either you don't understand what Randy Webb and I are trying to explain,
or we misunderstand you completely!

In your sample above...
* Are the three first columns input fields where
the user type in the number, text and state?
* What is Moredata?
* Is each row a separate form?
* Can you put this page (a simple sample) on a puplic server, so we can
see what you have done so far?

BTW...
You should be careful to reply with "Totally useless." to one of the most
knowledgeable contibutors in this NG, even if you feel insulted.
His words might seem a little bit harsh, but he *did* try to help you...
 
M

Mica Cooper

Wow,
Indiscriminate judging. I've never heard of you either. Doesn't make you
less of an expert...but you are pretty liberal with the accusations. I am
just not familiar with this technique or if it even works. I can however
infer something about your people skills. I do not appreciate the attitude
or telling me what I think.
Mica
 
M

Mica Cooper

Yes,

I need to recreate the whole page. It is the customers requirement. I did
say this. I don't think you listened.

I need to leave the page, storing all the user entered data, then return,
restoring the data. The link the user clicks on determines the next page.
Since its dynamic, I don't want to have to create a bunch of name=button_1
name=button_2 then check for them in the submit. I would prefer to pull
link?ID=1.

Mica
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated
Fri, 30 Jun 2006 09:46:00 remote, seen in
Randy Webb said:
Mica Cooper said the following on 6/30/2006 8:58 AM:


Corporate subscription site where the site author has no understanding
of forms, form submission, client side technology, server side
technology. Wow, I am impressed.

The post is coming from GMT-5 but not .ca - what else do you expect but
a combination of arrogance, ignorance, and stupidity?
 
B

Bart Van der Donck

Mica said:
I need to recreate the whole page. It is the customers requirement. I did
say this. I don't think you listened.

Your problem description is vague, unclear and not coherent. You don't
seem to have basic knowledge how client side scripts work.
I need to leave the page, storing all the user entered data,

Javascript can't do that. Where are you storing your data ?
then return, restoring the data.

Then you should read the stored data from the source you saved it to.
The link the user clicks on determines the next page.

Yes, that is how hyperlinks work.
Since its dynamic, I don't want to have to create a bunch of name=button_1
name=button_2 then check for them in the submit. I would prefer to pull
link?ID=1.

My best guess is that you mean something like this:

<a href="link.htm?ID=1&name=abc">link 1</a>
<a href="link.htm?ID=2&name=xyz">link 2</a>

If the query string depends on form values, see my earlier post in this
thread.
 
M

Mica Cooper

Ok,

How do I capture the user entered data so I can recreate the page??? This is
the third time I have stated that this is a requirement. Everyone skips over
this and criticizes me for being stupid but NO ONE answers the question. A
link will not allow that to happen. I need to submit the page to capture
that data and then forward.

It seems to me, everyone here is quick to judge and not read!

Mica
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Sat,
1 Jul 2006 09:51:32 remote, seen in Mica
Cooper said:
It seems to me, everyone here is quick to judge and not read!

If *you* were to read and heed the newsgroup FAQ about how to use News,
then it might be considered that you were actually worth helping.

In addition, you need to learn how, in asking a question, the
information that is necessary for the sort of answer that you hope for.
 
M

Mica Cooper

Is calling someone stupid by Randy Webb condoned then?
I need to pass some info in a javascript submit.
Randy Webb-No, you just think you do.

Because thats what he did! I did not make a mistake in my statement. I need
to pass info in a js submit. I suspected this was not a common thing so I
turned to the newsgroup. What I got was rudeness, judgement, and general ill
manners. I am not a newbie or a student and have been using newsgroups for
over 10 years. Read the posts. You are lecturing the wrong person.

I guess this can't be done by anyone here. Instead of creative help, I got
dumped on. I didn't want to create dynamic buttons tied to hidden data but
it will work even if its ugly.

Mica Cooper
 
D

Dag Sunde

Mica said:
Is calling someone stupid by Randy Webb condoned then?

Randy Webb-No, you just think you do.

Because thats what he did! I did not make a mistake in my statement.
I need to pass info in a js submit. I suspected this was not a common
thing so I turned to the newsgroup. What I got was rudeness,
judgement, and general ill manners. I am not a newbie or a student
and have been using newsgroups for over 10 years. Read the posts. You
are lecturing the wrong person.
I guess this can't be done by anyone here. Instead of creative help,
I got dumped on. I didn't want to create dynamic buttons tied to
hidden data but it will work even if its ugly.

Of course it can be done!

We only try to tell you that it is unneccessary complex and fragile
compared to the normal, standard way of just submitting a form.

The point that you don't understand what we mean because you have
your mind set on that it can't be done is a completely different question!

* If you want to use submit, that implies a <form> element.
* When a form is submitted, it is the content of the <input>, <select>
and other form fields that is _automaticlly_ submitted.
* whatever data you want to send to the server *must* be in one
of the form fields to be sendt by the form submission.
* If you want to send some additional data, depending on, ie. where
the user clicked, you use JS to set the content ao a hidden <input>
field before you execute submit.

* you can also of course send the content of several input fields
by clicking a link <a>, without having a form element at all.
_But then we're not talking about submitting at all!_
It is then a qouestion of building a request-string manually,
append it to the url, and forward. (see below):

function linkClicked(sender) {
var x1 = document.getElementById("x1").value;
var x2 = document.getElementById("x2").value;
var sId = sender.id;

var url = "receivingPage.php?x1=" + x1 + "&x2=" + x2 + "&linkId=" + sId;
window.location.href = url;
return false;
}

...
<a id="a1" href="NoJS.html" onclick="linkClicked(this); return
false;">Link a1</a>

* I asked you a list of specific questions regarding your requirements
in response to your post 2006-06-30 14:58:00 UTC+2, but you have still
not responded.

* When so many people ask questions about your approach, and show confusion
about what you are trying to achieve, you *might* consider that what you
think is a brilliant explanation was noting but confusing to the rest of
the
world...

* Answer my questions from the 30th, and stop whining, and I'll still help
you.
 
R

Randy Webb

Mica Cooper said the following on 6/30/2006 4:55 PM:
Wow,
Indiscriminate judging.

Nope, an observation based on your behavior. And from your other posts
in this thread, I was dead on.
I've never heard of you either.

Good thing I guess.
Doesn't make you less of an expert...

Doesn't make me more of one either.
but you are pretty liberal with the accusations.

Again, that wasn't an accusation, it was an observation.
I am just not familiar with this technique or if it even works.

It can be made to work. But the way you are trying to go about it is the
wrong approache.
I can however infer something about your people skills.

And you are welcome to your observations. You can even post them. I bet
your thoughts about me don't bother me near as bad as my observations
about you bothered you though.
I do not appreciate the attitude or telling me what I think.

Attitude? Deal with it. It comes from about 10 years of putting up with
people like you.

As for telling you what you think, I haven't even come close to doing that.
 
R

Randy Webb

Dr John Stockton said the following on 6/30/2006 6:18 PM:
JRS: In article <[email protected]>, dated
Fri, 30 Jun 2006 09:46:00 remote, seen in

The post is coming from GMT-5 but not .ca - what else do you expect but
a combination of arrogance, ignorance, and stupidity?

Aside from your anti-American bias and your general assumption that
anybody that posts from a particular Time Zone must be an idiot? Your
assumption is what is arrogant, ignorant and stupid John. It only
detracts from you, not complements it.
 
R

Randy Webb

Mica Cooper said the following on 6/30/2006 4:55 PM:
Yes,

I need to recreate the whole page. It is the customers requirement. I did
say this. I don't think you listened.

I did. You just didn't listen/read my response. If you want all the data
on the server, then submit a form, have the server recreate what it
needs. If you only want certain parts submitted, then you use separate
submit buttons and each can set flags to tell the server what to process
and what to ignore.
I need to leave the page, storing all the user entered data, then return,
restoring the data.

Submit it to the server, save it on the server, have the server recreate it.
The link the user clicks on determines the next page.

Makes sense. The next page is determined/created based on the link.
Simple enough.
Since its dynamic, I don't want to have to create a bunch of name=button_1
name=button_2 then check for them in the submit. I would prefer to pull
link?ID=1.

<input type="submit"
onclick="
document.forms.someHiddenField.value="this.id"
id="IDForThisRow">

Then the server gets the IDForThisRow and acts based on it.

How much simpler can it get?

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top