Skip to main content
Inspiring
August 1, 2006
Answered

Url Values to form

I am posting trying to pass the form contents through the url when the form is being submitted. But this is not working
The validations work, but when it comes to posting the form values
This topic is closed to new replies. Start a new post to keep the conversation going.
umuayoCorrect answer
Inspiring
August 2, 2006
Hello Ian Skinner,
This is what I want to accomplish. On the action page I need the form values to also appear on the url address bar also during form submittion.

Got it working. Changed the Method to get

5 replies

Inspiring
August 1, 2006
You didn't show your action page. So I'm going to ask an obvious
question first.

When data is passed through the URL query string it is accessed by the
URL scope, eg. url.classification, not the form scope, eg.
form.classification.

The form scope is populated then a form action="post" is sent.

Could this be the issue?

umuayo wrote:
> I am posting trying to pass the form contents through the url when the form is
> being submitted. But this is not working
> The validations work, but when it comes to posting the form values
>
>
> <script language="JavaScript" type="text/javascript">
> function getinfo()
> {
> var d = document.b;
> document.b.submit();
> }
>
> function validateForm()
> {
> var d = document.b;
> var Classification=d.Classification;
> var partno=d.partno;
> var stype=d.stype;
> var modelyear=d.modelyear;
> var mfg=d.mfg;
> var KeywordSearch=d.KeywordSearch;
> var searchType=d.searchType;
>
> if ((d.Classification[0].checked==true) ||(d.Classification[1].checked==true))
> {
> if (d.stype.selectedIndex==0)
> {
> alert("Vehicle type is a required field");
> d.stype.focus();
> return false;
> }
> }
>
> if (d.Classification[2].checked==true)
> {
> if ((d.partno.value=="")
> &&(d.KeywordSearch.value==""))
> {
> alert("Enter a value to search");
> d.partno.focus();
> return false;
> }
> }
> <cfoutput>
>
> page="searchresults.cfm?Classification=#Classification#&stype=#stype#&modelyear
> =#modelyear#&mfg=#mfg#&KeywordSearch=#KeywordSearch#&searchType=#searchType#";
> document.b.action=page;
> document.b.submit();
> </cfoutput>
> }
> </script>
>
Translate
umuayoAuthor
Inspiring
August 2, 2006
The Form Scope is post. What I intend to do is post the forms to query the DB and as well pass the form values as a url to the action page. The form contents are not sensitive. so there is no worry.

I need after the validation in script add all the forms.value to the action page for submittion
page="searchresults.cfm?Classification=#Classification#&stype=#stype#&modelyear=#modelyear#&mfg=#mfg#&KeywordSearch=#KeywordSearch#&searchType=#searchType#";
document.b.action=page;
document.b.submit();
Translate