AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ie and javascript

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
TeknoMusicMan



Joined: 14 Apr 2005
Posts: 188
Location: Wisconsin, USA

PostPosted: Sun Apr 17, 2005 6:49 pm    Post subject: ie and javascript Reply with quote

I know this isn't really the right forum to ask this in but I've seen a few IE java script questions and I didn't know where else to ask

I have a linksys router and i want to make a ahk script that will open the MacFilterTable.htm off the router and fill in a few fields with mac address's and then hit the apply button. At the moment I'm stuck and i can't get a javascript to set a field to something. I'm trying the following code.

Code:
javascript:document.FH.f_mac0.value=000000000000


000000000000 being the mac address im trying to filter

and nothing happens when i put that in the IE address bar and hit enter.
I'll post the source for the MacFilterTable.htm below

Code:
<html><title>MAC Access Control Table</title><script language=javascript>function selMAC(F){   F.submit();   return true;}function macsCheck(I){   var m;   if(I.value.length<2)      I.value=0;   else if(I.value.length==12)   {      for(i=0;i<12;i++)      {         m=parseInt(I.value.charAt(i), 16);         if( isNaN(m) )            break;      }      if( i!=12 )      {         alert('The WAN MAC Address is not correct!!');         I.value = I.defaultValue;      }   }   else   {      alert('The WAN MAC address length is not correct!!');      I.value = I.defaultValue;   }}</script><body bgcolor=white onLoad=window.focus()><center><table cellpadding=10 cellspacing=0 width=90% border=1><tr><td><table cellpadding=0 cellspacing=0 width=100% border=0><tr><td colspan=2><form name=F3 method=get action=Group.cgi><font color=blue face=Arial><b>Filtered MAC Address:</b> &nbsp; <select name=MAC_Filter_ID size=1 onChange=selMAC(this.form)><option value=0 selected>1~10</option><option value=1>11~20</option><option value=2>21~30</option><option value=3>31~40</option><option value=4>41~50</option></select></form></td></tr><form name=FH method=get action=Gozila.cgi><tr><td><ul><font face=verdana size=-1><b>mac 1:</td><td><input name=f_mac0 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 2:</td><td><input name=f_mac1 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 3:</td><td><input name=f_mac2 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 4:</td><td><input name=f_mac3 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 5:</td><td><input name=f_mac4 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 6:</td><td><input name=f_mac5 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 7:</td><td><input name=f_mac6 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 8:</td><td><input name=f_mac7 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 9:</td><td><input name=f_mac8 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr><tr><td><ul><font face=verdana size=-1><b>mac 10:</td><td><input name=f_mac9 size=12 maxlength=12 value=0 onChange=macsCheck(this)></td></tr></table></td></tr></table><input type=hidden name=macFilterEnd value=1><p><input type=submit value=' Apply '> <input type=reset value=' Undo '></form></center></body></html>
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Sun Apr 17, 2005 7:54 pm    Post subject: Reply with quote

I'm assuming the fields and buttons are set and wont move position, so wouldn't MouseMove/MouseClick and Send suffice?
_________________

Back to top
View user's profile Send private message Visit poster's website
daonlyfreez



Joined: 16 Mar 2005
Posts: 755
Location: Berlin

PostPosted: Mon Apr 18, 2005 11:40 am    Post subject: Reply with quote

I think in this case the onChange methods already in the html interfere. If I try your code, a new page is opened with a 0 in it. If I change it to text, the text is displayed in a new page. You could change the html before posting, but you could also do this instead:

javascript:document.FH.f_mac0.focus() to get focus on the first

And then start sending keys and tabbing...
_________________
(sorry, homesite offline atm)
Back to top
View user's profile Send private message
TeknoMusicMan



Joined: 14 Apr 2005
Posts: 188
Location: Wisconsin, USA

PostPosted: Mon Apr 18, 2005 2:49 pm    Post subject: Reply with quote

thanks, i just thought of that this morning. I know nothing about javascript so it took me a while to think of it Razz

but in the end I figured a way better way out.

the gozila.cgi imports the form's into back to the router.
So after a while i figured out the syntax for it and was able to make one link that blocked the 3 mac address's i need and then i can run that same link with just 0's instead of the mac's to let those mac's back at the internet.

I was trying to do all this because my brother got in some big ass troble and my parents are restricting his internet useage after 10pm till 6am so this script loops checking the time every so often when its 10pm it runs the link that blocks his 3 mac address's from accessing the internet. then at 6am it run's the link unblocking them.

It's kinda fun watching him switch ethernet cables around and switch his IP's at 10pm. He gets all pissed off because he can't figure out whats going on.

I also wrote a script that at 10pm just loops Process, Close for all his games till 6am. I named it svchost.exe and stuck it in his windows\system folder so he thinks its a valid process running Razz

I'm so EVUL Twisted Evil
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group