Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-07-2004, 10:07 AM   PM User | #1
blink
New to the CF scene

 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
blink is an unknown quantity at this point
Restricting People to Vote

Ok, sorry if I seem noobish as I pretty much am to Javascript.
What I want to do is enforce people to vote before proceeding to another website. The problem is its voting through an outside website, (the vote button is located on another website) and at the moment I am finding it very difficult on how to only let them continue if that button was pressed.
I have tried using frames, so that website will be shown within my website, but unfortunaely I just learned that Javascript cannot read the URL of a frames source if that source is from a different server.
All I had in mind was when you click the continue button, if the frame contained the page that would appear after you clicked the vote button, then let them through; otherwise display an alert.
However that idea will not work. What can I possibly do to make this work. Not being able to get any info on the voting frame is very frustrating. I have seen it done on many bigger websites..
Thankyou.
blink is offline   Reply With Quote
Old 07-07-2004, 11:44 AM   PM User | #2
lordofthesword8
New Coder

 
Join Date: Jun 2004
Location: Coventry, UK
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
lordofthesword8 is an unknown quantity at this point
Thumbs up Could you Clarify, and Heres What I Can Do

I dont understand what youre trying to do in a frame, and how do they choose who they want to vote for, is it: Text Box, Radio Button or Checkbox?

If you post the answers I will be able to help more.

Anyway, if you want a page to change after the vote button is clicked use this:

In the forms Vote button add this:

onclick="redirect()"

In the head copy and paste this:

<script language="javascript">
function redirect() {
window.location = "mainpage.htm"
}
</script>

If you change the location value to whatever site you want, then it should work. Note though that window.location is the same as a hyperlink, in that whatever filename you enter it is assumed to be in the sam folder as the voteing page.

This will work as for a user to enter the next page they will have to submit the form. There is also a way to check if they have selected something but I ahve left this out as you did not appear to need it. On the other hand if you do, just post!

Good luck and if you want more help, just post.

LOTS8

Last edited by lordofthesword8; 07-07-2004 at 11:47 AM.. Reason: Clarification
lordofthesword8 is offline   Reply With Quote
Old 07-07-2004, 12:08 PM   PM User | #3
blink
New to the CF scene

 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
blink is an unknown quantity at this point
Thankyou for your reply.

Yea I thought I might have to explain myself more. Ok.

What I have is my website. Now the voting I have in place is to vote for my website for the best one out of a list of other websites. Much like the Top 200 site websites you see around.

Now the page to click the vote button for my website is located on a totally different server to that of my website.

Ok, now I am trying to enforce special members of my site to vote before they are allowed access to a certain page. Now at first I tried doing this using frames. I was using two horizontal frames, the top one with my scripting and link to continue to restricted page, and the bottom one with the voting page (located on different server)
Now this plan failed miserably as I was going to only let the link proceed to the restricted page if the lower frame contained the page after voting; which would have meant they clicked the vote button and it loaded the next page confirming their vote went in.
That didnt work coz I just found out, Javascript cannot get information about a frame if the contents are from a different server.

So now Im stuck. How can I get this to work. I know it can be done as I have seen many sites do it.
Thankyou.
blink is offline   Reply With Quote
Old 07-07-2004, 12:32 PM   PM User | #4
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Since you don't have access (you can't modify it) to the voting site, there's nothing you can do about it.
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 11:53 AM.


Advertisement
Log in to turn off these ads.