|
 |
|
 |
10-01-2004, 12:55 AM
|
#1 (permalink)
|
|
Registered User
Join Date: Oct 2004
Location: indonesia
Posts: 7
|
ASP deperately need help plz!!!
i'm working on an asp form which have 2 submit button.onclick at button1 will open a pop-up window which going to show some result of calculated data which passed from form (calculated using stored procedure)and the button2 also need to use the data from the same form which means i need to submit the form twice. the problem is when i do first submit the page is being reloaded and the data that being filled by user is no longer exist for the 2nd submit.if tried to paste back the value to that page using request.form but it didn't work out perfectly and when i refreshed the page the value still there.
needed help immediately....already desperate
thx u
|
|
|
10-01-2004, 05:37 AM
|
#2 (permalink)
|
|
Masked Moderator
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
|
I'm a little confused on exactly what you are trying to accomplish. It would be easier if you posted your current code and we will go from there.
__________________
~Ryan
|
|
|
10-03-2004, 05:42 PM
|
#3 (permalink)
|
|
Registered User
Join Date: Oct 2004
Location: indonesia
Posts: 7
|
here is the code, i need the premi button to have the same function as the view button. it's just the premi button will open aa pop up window.
needed helpimediately thanx
PHP Code:
<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 form1_onsubmit()
{
var returnValue = false;
if ((form1.usia.value == "") || (parseInt(form1.usia.value) > 55))
{
alert("Masukkan usia Anda atau usia tidak boleh lebih dari 55!");
form1.usia.focus();
}
else if ((form1.invest.checked)&&(form1.bunga.value == ""))
{
alert("Masukkan data investasi Dana Carity!");
form1.bunga.focus();
}
else if ((form1.up.value == "")||(parseInt(form1.up.value) < 10000000))
{
alert("Masukkan uang pertanggungan dan uang pertanggungan tidak boleh kurang dari 10.000.000.-");
form1.up.focus();
}
else if ((form1.pa.checked)&&(parseInt(form1.usia.value)<20))
{
alert("Min usia masuk 20");
form1.usia.focus();
}
else if((form1.pa.checked)&&(parseInt(form1.uppa.value)<10000000))
{
alert("Minimum UP PA Rp. 10 juta");
form1.uppa.focus();
}
else if((form1.pa.checked)&&(parseInt(form1.uppa.value)>(parseInt(form1.up.value)*3)))
{
alert("maksimum UP PA 300% Uang Pertanggungan");
form1.uppa.focus();
}
else if ((form1.rjk.checked)&&(parseInt(form1.berjangka.value)<10000000))
{
alert("Masukkan tunganggan berjangka Minimal 10 juta");
form1.berjangka.focus();
}
else if ((form1.rjk.checked)&&(parseInt(form1.berjangka.value)>(parseInt(form1.up.value)*3)))
{
alert("Masukkan tunganggan berjangka tidak boleh lebih dari 300% uang pertanggungan");
form1.berjangka.focus();
}
else if ((form1.rwk.checked)&&(parseInt(form1.uprwk.value)<10000000))
{
alert("Masukkan tunganggan RWK Minimal 10 juta");
form1.uprwk.focus();
}
else if ((form1.rwk.checked)&&(parseInt(form1.uprwk.value)>(parseInt(form1.up.value)*3)))
{
alert("Masukkan tunganggan RWK tidak boleh lebih dari 300% uang pertanggungan");
form1.uprwk.focus();
}
else if ((form1.rdk.checked)&&(parseInt(form1.usia.value)<20))
{
alert("Usia masuk antara 20 th - 50 th");
form1.usia.focus();
}
else if ((form1.rdk.checked)&&(parseInt(form1.usia.value)>50))
{
alert("Usia masuk antara 20 th - 50 th");
form1.usia.focus();
}
else if ((form1.rdk.checked)&&(parseInt(form1.uprdk.value)<15000000))
{
alert("Minimum tunggangan Medisix adalah 15 juta");
form1.uprdk.focus();
}
else if ((parseInt(form1.uprdk.value)>(parseInt(form1.up.value)*0.5)))
{
alert("Maksimum tunggangan Medisix tidak boleh lebih dari 50% uang pertanggungan");
form1.uprdk.focus();
}
else
{
returnValue = true;
}
return returnValue;
}
function dad_opt(field1,field2)
{
if(parseInt(field1.value) < 20)
{field2.disabled = false;}
else
{field2.disabled = true;}
}
function tgt_chk(field1,field2)
{
if(parseInt(field1.value) >= 1500000)
{field2.disabled = false;}
else
{field2.disabled = true;}
}
function ivt_chk(field1,field2)
{
if(field1.checked == false)
{ field2.value=""; field2.disabled=true; }
else
{ field2.value=""; field2.disabled=false; form1.bunga.focus(); }
}
function jangka_klik(field1,field2)
{
if(field1.checked == false)
{field2.value = 0; field2.disabled = true;}
else
{field2.value = 10000000; field2.disabled = false;}
}
function rdk_klik(field1,field2)
{
if(field1.checked)
{field2.value = 15000000; field2.disabled = false;}
else
{field2.value = 0; field2.disabled = true;}
}
function rwk_klik(field1,field2)
{
if(field1.checked)
{field2.value = 10000000; field2.disabled = false;}
else
{field2.value = 0; field2.disabled = true;}
}
function hck_klik(field1,field2)
{
if(field1.checked)
{field2.disabled = false; field2.option=600,000; field2.value=600000;}
else
{field2.value = 0; field2.disabled = true; field2.option=600,000; field2.value=600000;}
}
function cara_klik(field1,field2,field3,field4)
{
if(field1[0].selected || field1[1].selected)
{ field2.disabled = false; }
else
{ field2.disabled = true; }
if(field1[1].selected && (parseInt(field4.value) > 20))
{ field3.disabled = true; }
else
{ field3.disabled = false; }
}
function pa_klik(field1,field2,field3)
{
if(field1.checked)
{field2.value = 10000000;
field2.disabled = false;
field3.style.display="inline";
}
else
{field2.value = 0; field2.disabled = true; field3.style.display="none"; }
}
function ce9()
{
var theform = document.form1;
theform.action = "submit_ce9_test.asp";
}
</script>
<style>
body {
font: 10px Verdana, Arial, Helvetica, sans-serif;
color: 000000;
}
table {
font: 10px Verdana, Arial, Helvetica, sans-serif;
color: 000000;
}
td {
vertical-align: top;
}
input {
font: 10px Verdana, Arial, Helvetica, sans-serif;
color: 000000;
}
select {
font: 10px Verdana, Arial, Helvetica, sans-serif;
color: 000000;
}
</style>
<div align="center"><font color="2D4198" size="+1" face="Arial"><strong>Central
Eksekutif </strong></font></div>
<p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="form1" method="post" onSubmit="return form1_onsubmit()">
<tr>
<td width="25%">Disajikan oleh</td>
<td width="2%"><div align="center">:</div></td>
<td colspan="2"><input name="disajikan" type="text"
<%if request.form("disajikan")="" then%> value= "PT Central"
<%else%> value= <%=request.form("disajikan")%>
<%end if%> size="35"></td>
</tr>
<tr>
<td>Disajikan Untuk</td>
<td><div align="center">:</div></td>
<td colspan="2"><input name="calon" type="text"
<%if request.form("calon")="" then%> value="Calon Tertanggung"
<%else%> value= <%=request.form("calon")%>
<%end if%> size="35"></td>
</tr>
<tr>
<td>Jenis Kelamin</td>
<td><div align="center">:</div></td>
<td colspan="2"><input name="jenis" type="radio" value="M" <%if request.form("jenis")="M" then
response.write(" checked")
else
response.write(" checked")
end if%>>
Pria
<input name="jenis" type="radio" value="F"<%if request.form("jenis")="F" then response.write(" checked")end if%>>
Wanita Usia
:
<input name="usia" type="text" size="3" onBlur="dad_opt(this.form.usia,this.form.dad)" value=<%=request.form("usia")%>>
Tahun</td>
</tr>
<tr>
<td>Masa Pertanggungan</td>
<td><div align="center">:</div></td>
<td colspan="2"><input type="text" name="edur" size="4" value="15" disabled>
Tahun
Masa Pembayaran :
<select name="pdur">
<option value="1"<%if request.form("pdur")="1" then response.write("selected") end if%>>1</option>
<option value="5" <%if request.form("pdur")="5" then
response.write("selected")
else
response.write("selected")
end if%>>5</option>
<option value="7"<%if request.form("pdur")="7" then response.write("selected") end if%>>7</option>
<option value="10"<%if request.form("pdur")="10" then response.write("selected") end if%>>10</option>
</select>
Tahun</td>
</tr>
<tr>
<td>Mata Uang</td>
<td><div align="center">:</div></td>
<td colspan="2"><input name="matauang" type="radio" value="rupiah" checked>
Rp
<input type="radio" name="matauang" value="dolar" disabled>
US$
Cara Pembayaran :
<select name="cara" onclick="cara_klik(this.form.cara,this.form.hck,this.form.dad,this.form.usia)" >
<option value="T" <%if request.form("cara")="T" then
response.write("selected")
else
response.write("selected")
end if%>>Tahunan</option>
<option value="X" <%if request.form("cara")="X" then response.write("selected") end if%>>Sekaligus</option>
<option value="S" <%if request.form("cara")="S" then response.write("selected") end if%>>Semesteran</option>
<option value="K" <%if request.form("cara")="K" then response.write("selected") end if%>>Kuartalan</option>
<option value="D" <%if request.form("cara")="D" then response.write("selected") end if%>>Dwibulanan</option>
<option value="B" <%if request.form("cara")="B" then response.write("selected") end if%>>Bulanan</option>
</select>
<!--<input name="cara" type="text" value="Tahunan" size="15" disabled>-->
</td>
</tr>
<tr>
<td height="17"><input name="invest" type="checkbox" id="invest" value="on" <% if request.form("invest")="on" then response.write(" checked") end if %>
onclick="ivt_chk(this.form.invest,this.form.bunga)">Ivestasi Tahapan Asumsi Bunga</td>
<td><div align="center">:</div></td>
<td colspan="2"><input name="bunga" type="text" size="3" maxlength="3" <% if request.form("invest")="on" then %> value= <%request.form("bunga")%>
<% else %> disabled <%end if%> >
% / Tahun</td>
</tr>
<tr>
<td>Uang Pertanggungan</td>
<td><div align="center">:</div></td>
<td colspan="2"><input name="up" type="text" id="up" value=<%=request.form("up")%>></td>
</tr>
<tr>
<td colspan="4"><div align="center"></div></td>
</tr>
<tr>
<td colspan="4"><strong>Rider / Tumpangan</strong> <div align="center"></div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td> <input type="checkbox" name="rjk" value="on" <% if request.form("rjk")="on" then response.write(" checked") end if %>
onclick="jangka_klik(this.form.rjk,this.form.berjangka)">
Berjangka</td>
<td> <div align="center">:</div></td>
<td colspan="2">UP Rp.
<input name="berjangka" type="text" <% if request.form("rjk")="on" then %> value=<%=request.form("berjangka")%>
<%else%> value="0" <%end if%> disabled></td>
</tr>
<tr>
<td> <input type="checkbox" name="rdk" value="on" <% if request.form("rdk")="on" then response.write(" checked") end if %>
id="rdkid" onclick="rdk_klik(this.form.rdk,this.form.uprdk)">
Medisix</td>
<td> <div align="center">:</div></td>
<td colspan="2">UP Rp.
<input name="uprdk" type="text" <% if request.form("rdk")="on" then %> value=<%=request.form("uprdk")%>
<%else%> value="0" <%end if%> disabled></td>
</tr>
<tr>
<td height="23"> <input type="checkbox" name="rwk" value="on" <% if request.form("rwk")="on" then response.write(" checked") end if %>
id="rwkid" onClick="rwk_klik(this.form.rwk,this.form.uprwk)">
RWK</td>
<td> <div align="center">:</div></td>
<td colspan="2">UP RP.
<input name="uprwk" type="text" <% if request.form("rwk")="on" then %> value=<%request.form("uprwk")%>
<%else%> value="0" <%end if%> disabled></td>
</tr>
<tr>
<td> <input type="checkbox" name="hck" value="on" <% if request.form("hck")="on" then response.write(" checked") end if %>
id="hckid" onclick="hck_klik(this.form.hck,this.form.uphck)">
HCP </td>
<td> <div align="center">:</div></td>
<td colspan="2">UP Rp.
<select name="uphck" disabled>
<option value="50000" <%if request.form("uphck")="50000" then response.write("selected") end if%> >50,000</option>
<option value="100000" <%if request.form("uphck")="100000" then response.write("selected") end if%> >100,000</option>
<option value="150000" <%if request.form("uphck")="150000" then response.write("selected") end if%> >150,000</option>
<option value="200000" <%if request.form("uphck")="200000" then response.write("selected") end if%> >200,000</option>
<option value="250000" <%if request.form("uphck")="250000" then response.write("selected") end if%> >250,000</option>
<option value="300000" <%if request.form("uphck")="300000" then response.write("selected") end if%> >300,000</option>
<option value="350000" <%if request.form("uphck")="350000" then response.write("selected") end if%> >350,000</option>
<option value="400000" <%if request.form("uphck")="400000" then response.write("selected") end if%> >400,000</option>
<option value="450000" <%if request.form("uphck")="450000" then response.write("selected") end if%> >450.000</option>
<option value="500000" <%if request.form("uphck")="500000" then response.write("selected") end if%> >500,000</option>
<option value="550000" <%if request.form("uphck")="550000" then response.write("selected") end if%> >550,000</option>
<option value="600000" <%if request.form("uphck")="600000" then
response.write("selected")
else
response.write("selected")
end if%> >600,000</option>
</select></td>
</tr>
<tr>
<td> <input type="checkbox" name="pa" value="on" <% if request.form("pa")="on" then response.write(" checked") end if %>
id="pa" onclick="pa_klik(this.form.pa,this.form.uppa,this.form.paclass)">
PA <span id="sub1">
<select name="paclass" style="display:none;">
<option value="A1" <%if request.form("paclass")="A1" then response.write("selected") end if%> >A1</option>
<option value="A2" <%if request.form("paclass")="A2" then response.write("selected") end if%> >A2</option>
<option value="B1" <%if request.form("paclass")="B1" then response.write("selected") end if%> >B1</option>
<option value="B2" <%if request.form("paclass")="B2" then response.write("selected") end if%> >B2</option>
</select>
</span></td>
<td> <div align="center">:</div></td>
<td colspan="2">UP Rp.
<input name="uppa" type="text" <% if request.form("rwk")="on" then %> value=<%request.form("uprwk")%>
<%else%> value="0" <%end if%> disabled></td>
</tr>
<tr>
<td><input type="checkbox" name="dad" value="on" <% if request.form("dad")="on" then response.write(" checked") end if %> disabled>
DAD
<div align="center"></div></td>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td height="20" colspan="7"><div align="center">
<input name="Premi" type="submit" id="Premi" value="Premi" onClick="javascript:Premi1('hitung_premi.asp')"> </div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td height="20" colspan="7"><div align="center">
<input type="submit" name="Submit" value="View" onClick="ce9()">
<input type="submit" name="Submit" value="Print">
</div></td>
</tr>
</form>
</table>
</p>
<p></p>
Last edited by redhead; 10-03-2004 at 10:19 PM.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 02:38 PM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|