469,352 Members | 1,653 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

onclick submit value text

Hi.

I am trying send a text value when click in an image.

If i write: onClick="javascript:document.client.submit();" send all form,
but i want to send only a input type text (name = cod), it´s possible?

Thanks.

Regards, José.
Jul 23 '05 #1
5 7547
"José Carlos" <jo********@siadv.com> wrote in message
news:cs**********@nsnmpen3-gest.nuria.telefonica-data.net...
Hi.

I am trying send a text value when click in an image.

If i write: onClick="javascript:document.client.submit();" send all form,
but i want to send only a input type text (name = cod), it´s possible?

Thanks.

Regards, José.


Have the onclick build a text field in a second form and submit it.

onclick="submit2()"

<script type="text/javascript">
function submit2() {
document.client2.cod.value = document.client.cod.value;
document.client2.submit();
}
</script>

<form name="client2">
<input type="hidden" name="cod">
</form>

Also, you don't need "javascript:" in your "onclick".

Jul 23 '05 #2
ok, it´s perfect. Thank.

Is possible send a form where i write everythings and add other thing.? I
want send a full form and add other text.

Regards.
"McKirahan" <Ne**@McKirahan.com> escribió en el mensaje
news:fK********************@comcast.com...
"José Carlos" <jo********@siadv.com> wrote in message
news:cs**********@nsnmpen3-gest.nuria.telefonica-data.net...
Hi.

I am trying send a text value when click in an image.

If i write: onClick="javascript:document.client.submit();" send all
form,
but i want to send only a input type text (name = cod), it´s possible?

Thanks.

Regards, José.


Have the onclick build a text field in a second form and submit it.

onclick="submit2()"

<script type="text/javascript">
function submit2() {
document.client2.cod.value = document.client.cod.value;
document.client2.submit();
}
</script>

<form name="client2">
<input type="hidden" name="cod">
</form>

Also, you don't need "javascript:" in your "onclick".

Jul 23 '05 #3
"José Carlos" <jo********@siadv.com> wrote in message
news:cs**********@nsnmpen3-gest.nuria.telefonica-data.net...
ok, it´s perfect. Thank.

Is possible send a form where i write everythings and add other thing.? I
want send a full form and add other text.

Regards.


[snip]

Sure; add hidden fields to hold your "other text".
Jul 23 '05 #4
I trying this one, but it isn´t that i want because i have several images
and several onclick events, depending of image i want to add diferent text.
If i add hidden fields it´s sent always.
"McKirahan" <Ne**@McKirahan.com> escribió en el mensaje
news:b_********************@comcast.com...
"José Carlos" <jo********@siadv.com> wrote in message
news:cs**********@nsnmpen3-gest.nuria.telefonica-data.net...
ok, it´s perfect. Thank.

Is possible send a form where i write everythings and add other thing.? I
want send a full form and add other text.

Regards.


[snip]

Sure; add hidden fields to hold your "other text".

Jul 23 '05 #5
ok, sorry. i would haven´t understand you. It´s perfect.

thank you by everythings.
"José Carlos" <jo********@siadv.com> escribió en el mensaje
news:cs**********@nsnmpen3-gest.nuria.telefonica-data.net...
I trying this one, but it isn´t that i want because i have several images
and several onclick events, depending of image i want to add diferent text.
If i add hidden fields it´s sent always.
"McKirahan" <Ne**@McKirahan.com> escribió en el mensaje
news:b_********************@comcast.com...
"José Carlos" <jo********@siadv.com> wrote in message
news:cs**********@nsnmpen3-gest.nuria.telefonica-data.net...
ok, it´s perfect. Thank.

Is possible send a form where i write everythings and add other thing.?
I
want send a full form and add other text.

Regards.


[snip]

Sure; add hidden fields to hold your "other text".


Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by EviL KerneL | last post: by
reply views Thread by none | last post: by
5 posts views Thread by Stuart Shay | last post: by
3 posts views Thread by Michael_R_Banks | last post: by
14 posts views Thread by Mtek | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.