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!

Form.Submit question 1

Status
Not open for further replies.

jimmythegeek

Programmer
May 26, 2000
770
US
In order to have client side validation, I use a "button" type button rather than a "submit" button. If everything validates, I do a frmMyForm.Submit. This works fine.

My question is, can I specify the Action as a parameter of the submit? for example:

frmNewEntity.Submit(Action='add_entity.asp?process=1')

If not, how can I dynamically change the query string on the submit?

Thanks in advance. Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
"can I specify the Action as a parameter of the submit"
yes sure you can:

document.formName.action=url
 
So would this work?

With frmNewEntity
.method = "post"
.action = "add_entity.asp?process=1"
.submit
End With Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
I think the syntax is more like this:
Code:
with frmNewEntity {
   .method = "post";
   .action = "add_entity.asp?process=1";
   .submit();
}

There's no EndWith, the "with" should be lowercase, and the whole with block should be just that - a block, enclosed in curly brackets. "submit" is a function call, so you need the parens after it. Also you should make it a habit of ending your statements with a semicolon.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
That is in Javascript, I did it like my previous post in VBScript, and it worked perfectly. Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
Sorry, I assumed since it was in the HTML and CSS forum it was intended to be javascript. Not a really bright assumption on my part, was it? Oh well, at least if anyone needs to see how to do it in js it's here as well. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Sorry, maybe I should have been in the VBScript forum. Besides it's nice to know how to do it in Javascript. Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
No, HTML & CSS is a language-neutral forum. That's why there are separate VBScript and Javascript forums.

I wouldn't mind seeing some DHTML Perl here for grins (of course this only applies to those who have ActivePerl or something installed on their clients). ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top