chrometweaks.org

Public or private option on iPage?

Click Here To View All Answers...


Got a quick question: Public or private option on iPage? Thanks for any comment. My 2nd question... I'm using osC MS2. On the Create Account page, when I click CONTINUE I get an error box from java script:.

A Runtime Error has occurred..

Do you wish to Debug?.

Line: 146.

Error: Object expected.

If I debug I just get the html of a table, which does me no good since I can't see where it's coming from. I've tried restoring the files involved (create_account.php, etc.) but to no avail..

If I click NO in the error box, one of two things can happen; either it goes to the page telling me the account was successfully created, or I get a 403 error saying I don't have access to view the page. However, checking my database, the account has actually been created..

Please help! I'm under a deadline to get this done. You can view the pages at:.

Www.outofitaly.com/catalog..

Comments (68)

I'm stumped. I'm not so sure what is the right answer. I'll do some research and get back to you if I bump into an useful answer. You should email the people at iPage as they probably could give you an answer..

Comment #1

I checked my admin and all the min/max values are defined. Is there any way to pinpoint where in the javascript the error is occurring? If I could do that it would be easier to fix. As it is, the output HTML file doesn't seem to help me do that...

Comment #2

It is the javascript error..

Please post the code form the file. and if you r using sts, please post the code from sts_template.html file too. it's v simple to fix. I cant do it without seeing the code...

Comment #3

I'm assuming the file that is causing the error is form_check.js.php, and here is the code as you requested Dan. Any help figuring this out would be greatly appreciated!.

<?php.

/*.

$Id: form_check.js.php,v 1.9 2003/05/19 19:50:14 hpdl Exp $.

OsCommerce, Open Source E-Commerce Solutions.

Http://www.oscommerce.com.

Copyright © 2003 osCommerce.

Released under the GNU General Public License.

*/.

?>.

<script language="javascript"><!.

Var form = "";.

Var submitted = false;.

Var error = false;.

Var error_message = "";.

Function check_input(field_name, field_size, message) {.

If (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {.

Var field_value = form.elements[field_name].value;.

If (field_value == '' || field_value.length < field_size) {.

Error_message = error_message + "* " + message + "\n";.

Error = true;.

}.

}.

}.

Function check_radio(field_name, message) {.

Var isChecked = false;.

If (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {.

Var radio = form.elements[field_name];.

For (var i=0; i<radio.length; i++) {.

If (radio[i].checked == true) {.

IsChecked = true;.

Break;.

}.

}.

If (isChecked == false) {.

Error_message = error_message + "* " + message + "\n";.

Error = true;.

}.

}.

}.

Function check_select(field_name, field_default, message) {.

If (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {.

Var field_value = form.elements[field_name].value;.

If (field_value == field_default) {.

Error_message = error_message + "* " + message + "\n";.

Error = true;.

}.

}.

}.

Function check_password(field_name_1, field_name_2, field_size, message_1, message_2) {.

If (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {.

Var password = form.elements[field_name_1].value;.

Var confirmation = form.elements[field_name_2].value;.

If (password == '' || password.length < field_size) {.

Error_message = error_message + "* " + message_1 + "\n";.

Error = true;.

} else if (password != confirmation) {.

Error_message = error_message + "* " + message_2 + "\n";.

Error = true;.

}.

}.

}.

Function check_password_new(field_name_1, field_name_2, field_name_3, field_size, message_1, message_2, message_3) {.

If (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {.

Var password_current = form.elements[field_name_1].value;.

Var password_new = form.elements[field_name_2].value;.

Var password_confirmation = form.elements[field_name_3].value;.

If (password_current == '' || password_current.length < field_size) {.

Error_message = error_message + "* " + message_1 + "\n";.

Error = true;.

} else if (password_new == '' || password_new.length < field_size) {.

Error_message = error_message + "* " + message_2 + "\n";.

Error = true;.

} else if (password_new != password_confirmation) {.

Error_message = error_message + "* " + message_3 + "\n";.

Error = true;.

}.

}.

}.

Function check_form(form_name) {.

If (submitted == true) {.

Alert("<?php echo JS_ERROR_SUBMITTED; ?>");.

Return false;.

}.

Error = false;.

Form = form_name;.

Error_message = "<?php echo JS_ERROR; ?>";.

<?php if (ACCOUNT_GENDER == 'true') echo ' check_radio("gender", "'ENTRY_GENDER_ERROR'");'"\n"; ?>.

Check_input("firstname", <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_FIRST_NAME_ERROR; ?>");.

Check_input("lastname", <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_LAST_NAME_ERROR; ?>");.

<?php if (ACCOUNT_DOB == 'true') echo ' check_input("dob", 'ENTRY_DOB_MIN_LENGTH', "'ENTRY_DATE_OF_BIRTH_ERROR'");'"\n"; ?>.

Check_input("email_address", <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_EMAIL_ADDRESS_ERROR; ?>");.

Check_input("street_address", <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_STREET_ADDRESS_ERROR; ?>");.

Check_input("postcode", <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>, "<?php echo ENTRY_POST_CODE_ERROR; ?>");.

Check_input("city", <?php echo ENTRY_CITY_MIN_LENGTH; ?>, "<?php echo ENTRY_CITY_ERROR; ?>");.

<?php if (ACCOUNT_STATE == 'true') echo ' check_input("state", 'ENTRY_STATE_MIN_LENGTH', "'ENTRY_STATE_ERROR'");'"\n"; ?>.

Check_select("country", "", "<?php echo ENTRY_COUNTRY_ERROR; ?>");.

Check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");.

Check_password("password", "confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_ERROR_NOT_MATCHING; ?>");.

Check_password_new("password_current", "password_new", "password_confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING; ?>");.

If (error == true) {.

Alert(error_message);.

Return false;.

} else {.

Submitted = true;.

Return true;.

}.

}.

//></script>..

Comment #4

Try changing the name of the file from .js.php to _js.php.

Take that extraout. I will see the code and post the reply. one thing. can you send me the link o fthe page. I will see which line it's giving the error and try to help...

Comment #5

This error usually means that there was a reference to an object that didn't exist. For example, if there was no field "city" of the form..

You CAN see where it is coming from - save the displayed HTML page to a file and find line 146 - it will likely be in the middle of the included form_check.js.php (which is the correct name) and the line will give you a strong hint as to what is missing...

Comment #6

I'm using osC MS2. On the Create Account page, when I click CONTINUE I get an error box from java script:.

A Runtime Error has occurred..

Do you wish to Debug?.

Line: 146.

Error: Object expected.

If I debug I just get the html of a table, which does me no good since I can't see where it's coming from. I've tried restoring the files involved (create_account.php, etc.) but to no avail..

If I click NO in the error box, one of two things can happen; either it goes to the page telling me the account was successfully created, or I get a 403 error saying I don't have access to view the page. However, checking my database, the account has actually been created..

Please help! I'm under a deadline to get this done. You can view the pages at:.

Www.outofitaly.com/catalog..

Comment #7

Make sure you have set values in each of the Minimum Values at Admin -> Configuration..

If any of these is blank, the javascript comparison for size will fail. That is what this looks like to me...

Comment #8


This question was taken from a support group/message board and re-posted here so others can learn from it.