?
Solved

load a page from a client side vbscript event handler...

Posted on 2001-08-29
10
Medium Priority
?
307 Views
Last Modified: 2008-02-01
I have a page with three radio buttons all named the same.  I also have an onclick vbscript event handler for the three radio buttons.  From the event handler, I would like to load another page, sort of like a form post, but without the form tags and submit button...any suggestions?

Preece
0
Comment
Question by:Preece
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 6

Accepted Solution

by:
JonFish85 earned 200 total points
ID: 6438341
try this maybe?

add this code right before the </HEAD> tag in your code:

<SCRIPT language=javascript>
<!--
function redirpage(pg)
{
  window.location.replace pg;
}
//-->
</SCRIPT>

then do something like this for your buttons:
<INPUT type=radio onclick="redirpage('test1.htm');">Test</INPUT>
<INPUT type=radio onclick="redirpage('test2.htm');"></INPUT>

hope this helps!
0
 

Expert Comment

by:agzis
ID: 6438342
You have 2 options:
 1. use window.open(...) method but the solution will use "GET" method.

 2. use form with all hidden members, method "post", obviosly and without submit button. Then programmicly modify send it using form.submit() method in your onclick
event.
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6438346
Something like this?

<script language=javascript>
  function fnSubmit()
  {
  document.MyForm.action="EmailPassword.asp";
  document.MyForm.method="post";
  document.MyForm.submit();
  return false;
  }
</script>

onclick="javascript:return fnSubmit()"
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Author Comment

by:Preece
ID: 6438351
agzis:

Could you please provide a simple example for both options?

Thanks,
Preece
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6438354
sorry, maybe I didnt realize you need to submit a form...
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6438447
Hi Preece,

I have already given you the example for # 2  :)
0
 

Expert Comment

by:agzis
ID: 6438482
Hi,
  JonFish85 almost gave you my 1st solution. My second solution is here.


put this somewhere in your ASP/HTML page:

<form name="frm1" method="POST" action="asdasd.asp">
  <input name="in1" type="hidden" value="1">
</form>

to submit use this:
   document.frm1.submit();
to access value of hidden field:
   document.frm1.in1.value = somevalue;
0
 
LVL 12

Author Comment

by:Preece
ID: 6438628
Thanks guys for the help and greate examples.  I am giving the points to JonFish because window.location.replace worked for my without the use of a form or submit and I did it using vbscript instead of javascript:  


<input type=radio name="optSortBy" value="a" onclick="gsnSortBy(value)" checked>Apples  
<input type=radio name="optSortBy" value="b" onclick="gsnSortBy(value)">Bananas
<input type=radio name="optSortBy" value="c" onclick="gsnSortBy(value)">Cherries


<script language=vbscript>
sub gsnSortBy(sValue)
     window.location.replace "showfruit.asp?sortby=" & sValue
end sub
</script>

Sincerely,
Preece
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6438644
glad I could help! thanks for the points and especially for the "A" grade!
0
 
LVL 12

Author Comment

by:Preece
ID: 6438652
I'm just having a lot of fun learning asp!  Being a well experienced vb developer, asp and vbscript is a natural progression for me.  Also, it is amazing what you can do...I am actually creating a database web app that looks and behaves similarly to a vb app!  Thanks again!

Preece
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question