Whe using a particular web page, the default values of the form are set
by a java function, then I can modify the web page and submit it.
But when I use Mechanize, I am having trouble figuring out how to get
those values so I can put them into the form I am going to submit.
Below is the function that has the data...and I have changed pertinent
info. What other choices might I have to accomplish this? I''m going
through multiple devices here, so the data is specific to the device,
if that wasn''t already obvious.
So basically, I want to get the default data, change one item (an IP
address), put it in the form, and submit it.
Thanks for any direction you might provide.
It''s kinda long, so I apologize:
function InitValue(passForm) {
// var snmp_ver = ''0'';
/*-----AP Password-----*/
passForm.http_username.value = ''username''; //
admin/user/0/username
passForm.http_passwd.value = ''supersecret''; //
admin/user/0/password
passForm.confirm_http_passwd.value = ''supersecret''; //
admin/user/0/password
passForm.webs_use_https.value = ''1'';
passForm.wireless_access_web.value = ''0'';
passForm.snmp_mode.value = ''1'';
passForm.snmp_ver.value = ''0'';
passForm.SYSContact.value = ''My Company (1-800-555-1212)'';
passForm.SYSName.value = ''System-14''; // system/name
passForm.SYSLocation.value = ''D217'';//system/location
passForm.SNMPUserName.value = '''';//snmp username
passForm.SNMPPassword.value = '''';//snmp passphrase
passForm.SNMPPassPhrase.value = '''';//snmp password
passForm.SNMPCommunityOne.value = ''public'';
passForm.SNMPCommunityTwo.value = ''public'';
passForm.SNMPTrapCommunity.value = ''public'';
var f = passForm ;
if( ''1'' == ''0'' )
f.webs_use_https[1].checked = true;
else
f.webs_use_https[0].checked = true;
if( ''0'' == ''0'' )
f.wireless_access_web[1].checked = true;
else
f.wireless_access_web[0].checked = true;
if( ''1'' == ''0'' )
f.snmp_mode[1].checked = true;
else
f.snmp_mode[0].checked = true;
if( ''0'' == ''0'' )
f.snmp_ver[0].checked = true;
else
f.snmp_ver[1].checked = true;
ChangeSNMP_Mode(''1'');
ChangeSNMP_Version(''0'');
SplitTrustHostIPAddress ( ''1.2.3.4'' );//SNMPTrustedHost
SplitSNMPTrapDestIPAddress ( ''0.0.0.0'' );//SNMPTrapDest
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.