Connecting Tech Pros Worldwide Forums | Help | Site Map

get form url without submit

finecur
Guest
 
Posts: n/a
#1: Feb 15 '07
Hi, here is my html:

<form action='mycgi.do'>
<input type=text name=a value=1>
<input type=text name=b value=1>
<input type=submit>
</form>

If I click the submit button, it will take me to mycgi.do?a=1&b=1.

Now my html got complicated. The fields inside the form as dynimacally
added/removed. And I do not want to leave my current page. But I just
want to get the target url (mycgi.do?a=1&b=1) of the form. Is there a
way to do that without submit the form?

Thanks,
f


Randy Webb
Guest
 
Posts: n/a
#2: Feb 15 '07

re: get form url without submit


finecur said the following on 2/14/2007 7:56 PM:
Quote:
Hi, here is my html:
>
<form action='mycgi.do'>
<input type=text name=a value=1>
<input type=text name=b value=1>
<input type=submit>
</form>
>
If I click the submit button, it will take me to mycgi.do?a=1&b=1.
>
Now my html got complicated. The fields inside the form as dynimacally
added/removed. And I do not want to leave my current page. But I just
want to get the target url (mycgi.do?a=1&b=1) of the form. Is there a
way to do that without submit the form?
Yes.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Bosconian
Guest
 
Posts: n/a
#3: Feb 15 '07

re: get form url without submit


"finecur" <finecur@yahoo.comwrote in message
news:1171500984.330886.216090@q2g2000cwa.googlegro ups.com...
Quote:
Hi, here is my html:
>
<form action='mycgi.do'>
<input type=text name=a value=1>
<input type=text name=b value=1>
<input type=submit>
</form>
>
If I click the submit button, it will take me to mycgi.do?a=1&b=1.
>
Now my html got complicated. The fields inside the form as dynimacally
added/removed. And I do not want to leave my current page. But I just
want to get the target url (mycgi.do?a=1&b=1) of the form. Is there a
way to do that without submit the form?
>
Thanks,
f
>
You can, of course, easily determine the value of the action attribute, but
you'll need to manually build the query string portion by looping through on
the elements.


Jim Land
Guest
 
Posts: n/a
#4: Feb 15 '07

re: get form url without submit


"Bosconian" <nobody@nowhere.comwrote in
news:PtednfdP2KL0eE7YnZ2dnUVZ_riknZ2d@comcast.com:
Quote:
And I do not want to leave my current page. But I just
Quote:
>want to get the target url (mycgi.do?a=1&b=1) of the form. Is there a
>way to do that without submit the form?
>>
>
You can, of course, easily determine the value of the action
attribute, but you'll need to manually build the query string portion
by looping through on the elements.
>
It would simplify the task if you could give the form a name or an id.
optimistx
Guest
 
Posts: n/a
#5: Feb 15 '07

re: get form url without submit


Randy Webb wrote:
Quote:
finecur said the following on 2/14/2007 7:56 PM:
....

But I just want to get the target url (mycgi.do?a=1&b=1) of
Quote:
Quote:
>the form. Is there a way to do that without submit the form?
>
Yes.
?


ASM
Guest
 
Posts: n/a
#6: Feb 15 '07

re: get form url without submit


optimistx a écrit :
Quote:
Randy Webb wrote:
Quote:
>finecur said the following on 2/14/2007 7:56 PM:
>
But I just want to get the target url (mycgi.do?a=1&b=1) of
That is not the target but the action (of your form) ...
Quote:
Quote:
Quote:
>>the form. Is there a way to do that without submit the form?
>Yes.
>
?
Ways are infinite :-)

example :

<form action='mycgi.do'
onsubmit="return confirm('This action is :\n'+
this.action+'?a='+this.a.value+'&b='+this.b.value+ '\n'+
'Is it OK ?');">
<input type=text name=a value=1>
<input type=text name=b value=1>
<input type=submit>
</form>

Tell exactly what you want.

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
finecur
Guest
 
Posts: n/a
#7: Mar 2 '07

re: get form url without submit


On Feb 15, 1:38 am, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Quote:
optimistx a écrit :
>
Quote:
Randy Webb wrote:
Quote:
>finecursaid the following on 2/14/2007 7:56 PM:
>
Quote:
But I just want to get the target url (mycgi.do?a=1&b=1) of
>
That is not the target but the action (of your form) ...
>
Quote:
Quote:
>the form. Is there a way to do that without submit the form?
Yes.
>
Quote:
?
>
Ways are infinite :-)
>
example :
>
<form action='mycgi.do'
onsubmit="return confirm('This action is :\n'+
this.action+'?a='+this.a.value+'&b='+this.b.value+ '\n'+
'Is it OK ?');">
<input type=text name=a value=1>
<input type=text name=b value=1>
<input type=submit>
</form>
>
Tell exactly what you want.
>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Thank you for your post. What about if I have a <input type=filein
my form? How can I manually make the aciton ?

Thanks again

Closed Thread