 |
|
|
 |
|
 |
Hello,
This code seems almost perfectly what I was looking for. I wonder if it is possible to change the action however.
I would like, when I click on button1, to be send to an url with the formvalue behind it instead to Page.aspx.
I will use http:///www.google.com/search?= as an example url with test as formvalue/searchword. The OnButton1 function then should direct me to http:///www.google.com/search?=test.
Is that possible? And how?
function OnButton1()
{
document.Form1.action = "Page1.aspx"
document.Form1.target = "_blank"; // Open in a new window
document.Form1.submit(); // Submit the page
return true;
}
|
|
|
|
 |
|
 |
I needed a quick answer and I found it here within seconds. Excellent work.
|
|
|
|
 |
|
 |
Hi ,
I am submitting a html form in ASP.NET 1.1, to a websphere server. I am browsing excel file and submitting through object to Websphere server, by sybmitting form with action as Websphere hosted address.
Whenever I login to app, and try to upload the file with above functionality, for the first time, I get redirected to Login.aspx automatically. But when I re-login again and does the same thing as above, the file is uploaded successfully.
Can you please help me regarding this, as I have maintained releative values of timeout for session and form-authentication in web.config file.
- Ajay K
|
|
|
|
 |
|
 |
hi,
this was an excellent article on multiple actions on a single form. i used it. it worked ok, but no data was sent with it. when i got to the new page, and used request.form("field_name") not data was found. what can i do to send the data with this method?
thanks.
|
|
|
|
 |
|
 |
Hi,
Coding is not my specialty so I am struggling with getting this to work.
Basically, I need to have a simple form with a textarea and a submit button.
A user should input a number, if the number is 7 digits in length, it should go to one site, if less than 7 digits it should go to another website.
My code is:
<html>
<head>
<script type="text/javascript">
function validate()
{
var accNo=document.getElementById("accNo").value
submitOK="true"
if (accNo.length>7)
{
alert("The account number you entered is not valid. Please try again.")
submitOK="false"
}
<-- if (accNo.length==7)
(
Set value to load page 1
)
Else
Set value to load page 2
-->
if (submitOK=="false")
{
return false
}
}
</script>
</head>
<body>
<form action="http://www.google.com.au" önsubmit="return validate()">
Account Number: <input type="text" id="accNo" size="20">
<input type="submit" value="Submit">
</form>
</body>
</html>
Can anyone help me out? Any help would be greatly appreciated as I am going insane trying to do this - coding isnt my forte! (qesaf@hotmail.com)
Cheers.
|
|
|
|
 |
|
 |
Hi !!
A question: About this form,
it is not possible to better it using only one single function for the two buttons, creating function called, for example, Onbutton ???
|
|
|
|
 |
|
 |
Thanks, Chris, for spending that 1/2 day of messing around, and sharing the results so I didn't have to spend the same 1/2 day. You solved my problem in 5 minutes.
|
|
|
|
 |
|
 |
I'm trying to do this using an ASP requestor page that has dynamically filled dropdown info that I want to pass in the form. I keep getting "document.form1 is null or not an object" error. Obviously I am a newbie at this, but sure could use some help.
-- modified at 16:29 Thursday 1st June, 2006
|
|
|
|
 |
|
 |
Hi I'm trying to do something related, but not quite the same
Basically I have two sites that I want to log into, using one login form.
The form needs a hidden input, but the value of that needs to be different for each site
Also, the names of the inputs need to be different.
For example in pseudo code
(hidden input Entity=1234)
Login (name=loginname value="")
Password (name=mypassword value="")
(INPUT type="button" value="Button1" name=button1 onclick="return OnButton1();")
(INPUT type="button" value="Button2" name=button2 onclick="return OnButton2();")
onbutton1
Superloginname=loginname
pswrd=mypassword
onbutton 2
lgntowebsite=loginname
passcode=mypassword
Entity=5678
Make any sense? Any ideas?
|
|
|
|
 |
|
 |
Now that I've thought this over a bit more, what I really need is to be able to input some values to generic named variables, then depending which buttons are pushed, assign SOME of those variable values to specifically named variables, and use those to post to a url.
So basically say in the inputs are: name, password
onbutton1 -> myname=name, pswrd=password, entity=1234
onbutton2 -> login=name, pass=password
so i wouldn't send the entity value to the 2nd url, just the 1st.
|
|
|
|
 |
|
 |
This script is just what I need, but I dont understand .asp.
I need the page 1 and 2 .asp scripts in javascript.
Can anyone help?
Thanks
trixy.
|
|
|
|
 |
|
 |
Hi
when i use a form along with post attribute.How will i retrieve the data send at the page specified in the action attribute??
|
|
|
|
 |
|
 |
I found your posts concerning this problem, and I have a question. I'm working on a site in which a page exists for requesting a brochure (with php for sending the data via e-mail and entering some info into a database). When clicking on the submit button, the client is taken to a thank you page. I've added two new buttons for people who wish to open a pdf and print the brochure themselves (at the bottom left of the URL below). We'd like to send the form data with these two new buttons, which also triggers the opening of the thank you page; and open the pdf in a new window. As of right now, the previous buttons still work fine (at the bottom right of the URL below), but the new input buttons I've implemented using Chris' code only open the pdf into a new window, and the thank you page does not load.
Can anyone help with ideas?
Here is the URL. It's in French, but that shouldn't matter to understand the code.
http://www.businesstalkfrance.com/site/fr/brochure_frTest.php
TIA,
Keith (keith@keithsarver.com)
|
|
|
|
 |
|
 |
i've found one problem with Chris' code, if you have say a hidden field in your form named *action*, you'll get an error saying *object does not support this property or method*
|
|
|
|
 |
|
 |
Dear,
I want to know , how to send one message to many message boards, like "message board submitter". How the form action is created? please few examples of web sites.
(or)
How "one form" is used to post "multi message boards" ?
tgopala_krishna
|
|
|
|
 |
|
 |
I know others have been asking the same thing... but i'm still confused on what to do.
I have 1 form in which i need to send credit card information to the merchant account via calling an asp script. But than i also need to send the form to a mail recipient using the form action as follows: http://www.onr.com/cgi-bin/formmail.cgi
Both are pretty simple to execute individually... but how can i do both with one submit button...
Please give it to me Barney style, as i'm not really good with coding yet... any help/suggestions/tips, is appreciated. Thanks in advance.
|
|
|
|
 |
|
 |
I have a form in my asp page. Now when the form is submited i want to show the error messages on the client side in the page (eg inside a table)
Please tell me how will this be possible
I will be thankful if u refer some example link to me
|
|
|
|
 |
|
 |
Can we do two actions with one button? I can make my form do an insert record into the database and I can also get it to send an e-mail. How do I get it to do both with one submit button. My users would be confused by two buttons.
Thanks.
Judi
|
|
|
|
 |
|
 |
You can make one button open 2 windows - or open 1 window in a submit handler and then continue on with the submission. See window.open
cheers,
Chris Maunder
|
|
|
|
 |
|
 |
I tried to use this code , but it did not work.
<form name="form1" method="post" action="save.php" önSubmit="mailto:nie.then@mailcity.com?subject=test">
...
</form>
|
|
|
|
 |
|
 |
Hi there Chris, I just joined the code project. Any chance you can give us an example of having two actions and one button. I'm having trouble understanding how to use "window.open" Thank you for your time.
|
|
|
|
 |
|
 |
I was looking for a way to post from one frame to another. I ended up using javascript to construct a long get and set the frame src, but this looks like a better method I'm sure I can just replace target with the name of the other frame.
Thanks Buddy and Merry Chirstmas!
|
|
|
|
 |
|
 |
This just saved me from spending an hour looking around through some reference material on how to do this. A Big Thanks To You My Man Down Under
Nick Parker
|
|
|
|
 |
|
 |
i want a form to have two actions, but simultaneously, rather than a button for each. i.e., i have two different cgi prog's i want called when i hit submit, is this possible? any help at all i'd be really grateful - dan
|
|
|
|
 |