Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 10-07-2004, 12:31 AM   #1 (permalink)
RusH
Registered User
 
Join Date: Oct 2004
Location: indonesia
Posts: 7
RusH is on a distinguished road
Question javascript + asp submit problem

here is the problem,i've got 2 submit button and also 2 forms in one page. says like this


<script>
function Premi1(url)
{
var newWindow;
var properti = 'scrollBars=yes, resizable=no, toolbar=no, menubar=no, location=no, directories=no, width=450, height=250, top=150, left=150';
newWindow = window.open(url, "Hitung_Premi", properti);
}
</script>

<script language="JavaScript">
function ce9()
{
var theform = document.form1;
theform.action = "submit_ce9_test.asp";
}
</script>

<form name="form1" method="post" onSubmit="return form1_onsubmit()">
<tr>
<td colspan="2"><input name="bunga" type="text" size="3" maxlength="3" onChange="document.form2.bunga2.value=this.value" disabled> % / Tahun</td>
</tr>

<tr>
<td height="20" colspan="7"><div align="center"> <input name="Premi" type="button" id="Premi" value="Premi" onClick="javascriptremi('hitung_premi.asp');java script:form2.submit();"> </div>
</td>
</tr>

<tr>
<td height="20" colspan="7"><div align="center">
<input type="submit" name="Submit" value="View" onClick="ce9()">
</td>
</tr>
</form>


<form name="form2" method="post">
<tr>
<td><input name="bunga2" type="hidden" id="bunga2" size="3" maxlength="3">
</td>
</tr>
</form>

so what i want is when i click the "premi" button it will submit form2 without reload the page.
is it possible to do so??and how to do that??
thx u
RusH is offline   Reply With Quote
Old 11-04-2004, 09:26 AM   #2 (permalink)
kaeli69
Registered User
 
kaeli69's Avatar
 
Join Date: Apr 2003
Posts: 30
kaeli69 is an unknown quantity at this point
Quote:
so what i want is when i click the "premi" button it will submit form2 without reload the page.
is it possible to do so??and how to do that??
No. Submitting a form always changes the page to the action page if there is no target.
Now, you could use a different target and submit it to a new window, an IFRAME, or whatever, but you can't submit it as it is written without losing the page.

If you're using .net, check out postback.
kaeli69 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP deperately need help plz!!! RusH MS Technologies ( ASP, VB, C#, .NET ) 2 10-03-2004 05:42 PM
javascript riddle: why won't my form submit from this text link? sde HTML, XML, Javascript, AJAX 6 09-29-2004 05:56 AM
Using javascript to submit a form sammy HTML, XML, Javascript, AJAX 2 07-15-2004 01:31 PM
JavaScript Problem dawkim HTML, XML, Javascript, AJAX 2 01-26-2004 07:02 PM


All times are GMT -8. The time now is 09:59 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting