Page 1 of 1

cannot submit form with JS :(

Posted: Sun Sep 25, 2005 2:06 pm
by jmut
Don't mind the {} code...its smarty template egnine

Code: Select all

<script language="javascript" type="text/javascript">
    function displayItem(id,shouldDisplay) {
        var elem = document.getElementById(id);
        if (shouldDisplay == true) {
            elem.style.display = 'inline';
        } else {
            elem.style.display = 'none';
        }
    }

    function checkRequiredFields() {
        var small_text = document.getElementById('h_small_text').innerHTML.replace(/^\s*|\s*$/g,"");//str
        var main_text = document.getElementById('tiny_mce2').innerHTML.replace(/^\s*|\s*$/g,"");//str
        var price_from = document.getElementById('h_price_from').value;//int
        var offer_name = document.getElementById('offer_name').value.replace(/^\s*|\s*$/g,"");//str
        var stars = document.getElementById('h_stars').value;//int
        if (small_text != '' && main_text != '' && price_from !=0 && stars !=0 && offer_name!='') {
            var d = document.getElementById('s');
            d.value = 2;
          document.form.hotel_form.submit();
            return true;
        } else {
            displayItem('error_table',true);
            return false;
        }
        return false;
    }
  </script>

<table width="900" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFD595">
<tr bgcolor="#FFEBCC">
    <td colspan="{$tf+1}" align="left" valign="top"><button onclick="if([b]checkRequiredFields())[/b] return true; else return false;" onmouseout="displayItem('error_table',false)">Rooms</button></td>
    
</tr>
</table>
<table  id="error_table" width="900" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFD595" style="display:none">
<tr bgcolor="#FFEBCC">
    <td colspan="{$tf+1}" align="left" valign="top"><p style="color:red;">Make sure you first fill in fields Offer name,Prices from,Small preview text, Main offer text and Stars</p></td>
</tr>
</table>
I know its lame code...but I am quite new to javascript
Can someone explain me what is worng with this. Why can't I submit the form

the problem is "document.form.hotel_form.submit();"
Error: document.form has no properties
Source File: ..../admin/offerh.php?offer_id=95&from=0&type=beach
Line: 291

All I really need to do is:
var d = document.getElementById('s').value=2;
submit the stupid form;

But this doesn't work as well.
Yes, there is form id,name called hotel_form

Posted: Sun Sep 25, 2005 2:20 pm
by feyd
you'll likely have an error like "document.form has no properties."

it's document.forms

Posted: Sun Sep 25, 2005 3:28 pm
by jmut
feyd wrote:you'll likely have an error like "document.form has no properties."

it's document.forms
Error: document.forms.hotel_form.submit is not a function
Source File: http://findbulgaria/admin/offerh.php?of ... =skiresort
Line: 237

Doesn't work either

I tried as simple as

Code: Select all

<script language="javascript" type="text/javascript">
    function do_me() {
            document.getElementById('s').value = 2;
            document.forms.hotel_form.submit();
    }
</script>
<td colspan="{$tf+1}" align="left" valign="top"><a onclick="do_me()" href="">Rooms</a></td>
Thats all the functionality I really need :(
's' is hidden input tag and I need to change its value before submitting.

Here is how te form tag starts

Code: Select all

<form id="hotel_form" name="hotel_form" method="POST" action="" enctype="multipart/form-data">

Posted: Sun Sep 25, 2005 3:36 pm
by feyd
try

Code: Select all

document.forms['hotel_form'].submit()

Posted: Sun Sep 25, 2005 4:42 pm
by jmut
feyd wrote:try

Code: Select all

document.forms['hotel_form'].submit()
This is all I am running

Code: Select all

function do_me() {
    var d = document.getElementById('s');
    d.value = 2;
    document.forms['hotel_form'].submit();
    }

<td colspan="{$tf+1}" align="left" valign="top"><button onclick="do_me()">Rooms</button></td>
Error: document.forms.hotel_form.submit is not a function
Source File: http://findbulgaria/admin/offerh.php?of ... =skiresort
Line: 168

I tried it completely isolated and it gives no error but I have no idea what the problem is :(

Code is running as expected(even with the error) on FF but not in IE...it crashes on the error.

Posted: Sun Sep 25, 2005 4:49 pm
by feyd
The error should have changed to reflect the new code if that was the line I believe.........

Posted: Sun Sep 25, 2005 4:54 pm
by jmut
feyd wrote:The error should have changed to reflect the new code if that was the line I believe.........
You can quickly search the problem area with "do_me()" or submit()......
This is the whole page....copied from view source
I have no idea what the error should really be...I just copy the one from Javascript Console(FF)

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Hotels: Ski Resort Hotels</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="menu.css" rel="stylesheet" type="text/css"  />
<link href="adminstyle.css" rel="stylesheet" type="text/css"  />


<!--<script type="text/javascript" src="./ie5.js"></script>-->
<!--<script type="text/javascript" src="./DropDownMenuX.js"></script>-->

<script language="javascript" type="text/javascript" src="tiny_mce/tiny_mce.js"></script>

<script language="javascript" type="text/javascript">
    tinyMCE.init({
        verify_html : true,
        mode : "exact",
        elements : "tiny_mce,tiny_mce2,golf_tiny",
        theme : "advanced",
        plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen",
        theme_advanced_buttons1_add_before : "save,newdocument,separator",
        theme_advanced_buttons1_add : "fontselect,fontsizeselect",
        theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
        theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
        theme_advanced_buttons3_add_before : "tablecontrols,separator",
        theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_path_location : "bottom",
        plugin_insertdate_dateFormat : "%Y-%m-%d",
        plugin_insertdate_timeFormat : "%H:%M:%S",
        extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
    });
</script>



<script language="javascript" type="text/javascript">
function textCounter(field,cntfield,maxlimit) {
    cntfield = document.getElementById("remLen"+cntfield);
    //if too long
    if (field.value.length > maxlimit)
    field.value = field.value.substring(0, maxlimit);
    //update counter
    else
    cntfield.innerHTML = maxlimit - field.value.length;
    }
</script>


<!--{include file="javascript.html"}-->

</head>




<body>

    <table width="780" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="25" colspan="8" valign="middle"><table width="780" border="0" cellpadding="0" cellspacing="0" height="25" >
        <tr>
          <td width="55" class="nav"><a href="index.php">Home</a></td>
          <td width="116" class="nav"><a href="prefs.php?r=%2Fadmin%2Fofferh.php%3Foffer_id%3D93%26from%3D0%26type%3Dskiresort">Preferences</a>&nbsp;</td>
          <td width="207" class="nav"><a href="login.php?action=logout">Log out</a></td>

    <td width="402" colspan="3" align="right" valign="top" class="status">Hotels: Ski Resort Hotels</td>     </tr>
      </table></td>

  <tr>
    <td width="154" height="22" class="cat" >Site Specific:</td>
    <td colspan="2" class="item"> <a href="textedit.php">Text editor</a></td>
    <td width="108" class="item"><a href="cityadmin.php">City admin</a></td>

    <td colspan="4" class="item">&nbsp;</td>
  </tr>
  <tr>
    <td height="22" class="cat" > Hotels & Apartments:</td>
    <td colspan="2" class="item"><a href="offerh.php?type=beach">Beach Resort
      Hotels</a></td>
    <td class="item"><a href="offerh.php?type=skiresort">Ski Resort Hotels</a></td>

    <td width="72" class="item"><a href="offerh.php?type=city">City Hotels</a></td>
    <td width="114" class="item"><a href="offerh.php?type=beachap">Beach Apartments</a></td>
    <td width="98" class="item"><a href="offerh.php?type=skiap">Ski Apartments</a></td>
    <td width="109" class="item"><a href="offerh.php?type=cityap">City Apartments</a></td>
  </tr>
  <tr>
    <td height="22" class="cat" >Alternative holidays:</td>

    <td width="86" class="item"><a href="offerh.php?type=golf">Golf Hotels</a></td>
    <td width="39" class="item"><a href="offera.php?type=golf">Golf</a></td>
    <td class="item"><a href="offera.php?type=climbing">Climbing</a></td>
    <td class="item"><a href="offera.php?type=biking">Biking</a></td>
    <td class="item"><a href="offera.php?type=hiking">Hiking</a></td>
    <td class="item"><a href="offera.php?type=hunting">Hunting</a></td>

    <td class="item"><a href="offera.php?type=agricultural">Agricultural</a></td>
  </tr>
  <tr>
    <td height="22" class="cat" >Rent a car & Others:</td>
    <td colspan="7" class="item"><a href="offerr.php">Rent a car</a></td>
  </tr>

</table>
<p>&nbsp;</p><p>&nbsp;</p>





<form id="hotel_form" name="hotel_form" method="POST" action="" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="300000" />
<input id="s" type="hidden" name="s" value="1" />
<input type="hidden" name="type" value="skiresort" />
<input type="hidden" name="from" value="0" />
<input type="hidden" name="offer_id" value="93" />
<table width="900" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFD595">
    <tr>
        <td><strong>Name:</strong></td>

        <td><input id="offer_name" name="offer_name" type="text" value="Text">
        </td>
        <td class="xsmall">&nbsp;</td>
    </tr>
    <tr>
        <td width="89"><strong>Address:</strong></td>
        <td width="168"><input type="text" name="h_address" value="dfssfd"> </td>
        <td class="xsmall">&nbsp;</td>

    </tr>
    <tr>
        <td>
            <strong>Prices from:</strong>
        </td>
        <td>
            <input id="h_price_from" name="h_price_from" value="123" size="8" type="text">$
        </td>
    </tr>

</table>
<br>

  <script language="javascript" type="text/javascript">
    function displayItem(id,shouldDisplay) {
        var elem = document.getElementById(id);
        if (shouldDisplay == true) {
            elem.style.display = 'inline';
        } else {
            elem.style.display = 'none';
        }
    }

    function checkRequiredFields() {
        var small_text = document.getElementById('h_small_text').innerHTML.replace(/^\s*|\s*$/g,"");//str
        var main_text = document.getElementById('tiny_mce2').innerHTML.replace(/^\s*|\s*$/g,"");//str
        var price_from = document.getElementById('h_price_from').value;//int
        var offer_name = document.getElementById('offer_name').value.replace(/^\s*|\s*$/g,"");//str
        var stars = document.getElementById('h_stars').value;//int
        if (small_text != '' && main_text != '' && price_from !=0 && stars !=0 && offer_name!='') {
            var d = document.getElementById('s');
            d.value = 2;
            document.form.hotel_form.submit();
            return true;
        } else {
            displayItem('error_table',true);
            return false;
        }
        return false;
    }

    function do_me() {
    var d = document.getElementById('s');
    d.value = 2;
    document.forms['hotel_form'].submit();
    }
  </script>

<table width="900" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFD595">
<tr bgcolor="#FFEBCC">
    <!--<td colspan="10" align="left" valign="top"><a href="offerh.php?type=skiresort&offer_id=93&rm=t" target="_blank" onclick="if(checkRequiredFields()) return true; else return false;" onmouseout="displayItem('error_table',false)"><strong>Rooms</strong></a></td>-->
    <!--<td colspan="10" align="left" valign="top"><button onclick="if(checkRequiredFields()) return true; else return false;" onmouseout="displayItem('error_table',false)">Rooms</button></td>-->
    <td colspan="10" align="left" valign="top"><button onclick="do_me()">Rooms</button></td>
</tr>

</table>
<table  id="error_table" width="900" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFD595" style="display:none">
<tr bgcolor="#FFEBCC">
    <td colspan="10" align="left" valign="top"><p style="color:red;">Make sure you first fill in fields Offer name,Prices from,Small preview text, Main offer text and Stars</p></td>
</tr>
</table>
<br>
<table width="900" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFEBCC">
    <tr>
        <td width="100"><strong>Stars:</strong></td>
        <td>

            <select name="h_stars" id="h_stars">
                <option value="0"> - Select - </option>
                <option value="1">1 - One star</option>
                <option value="2">2 - Two stars</option>
                <option value="3" selected>3 - Three stars</option>
                <option value="4">4 - Four stars</option>

                <option value="5">5 - Five stars</option>
            </select>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"><strong>Facilities</strong></td></tr>
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">

                <tr>
                    <td><strong>Health & Sport:</strong></td>
                </tr>
                <tr>

<!--                          -->
                                                <td width="20%">
                        <input type="checkbox" name="am[1]" />
                        Indoor pool
                                                </td>

<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[2]" />
                        Gym
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[3]" />
                        Sauna
                                                </td>
<!--                          -->

                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[4]" />
                        Massaging
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[5]" />
                        Tennis Court
                                                </td>

<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[6]" />
                        Table Tennis
                                                </td>
<!--                          -->
                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[7]" />
                        Pool Tables
                                                </td>

<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[8]" />
                        Bowling Alley
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[9]" />
                        Swimming Pool
                                                </td>
<!--                          -->

                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[10]" />
                        Medical Staff (Day Time Only)
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[11]" />
                        Medical Staff (24h)
                                                </td>

<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[50]" />
                        Ski Rentals
                                                </td>
<!--                          -->
                                                </tr><tr>
                                                                    </tr>
                </tr>
            </table>

        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr>
                    <td><strong>Money & Information Related:</strong></td>

                </tr>
                <tr>

<!--                          -->
                                                <td width="20%">
                        <input type="checkbox" name="am[12]" />
                        Hotel Safe
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[13]" />

                        Currency Exchange Bureau
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[14]" />
                        General conference room
                                                </td>
<!--                          -->
                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[15]" />

                        Internet Access In Public Areas (Including Workstation)
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[16]" />
                        Internet Access In Public Areas (Access Point without supplied Worksta
                                                </td>
<!--                          -->
                                                                    </tr>
                </tr>
            </table>

        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr>
                    <td><strong>Recreation:</strong></td>

                </tr>
                <tr>

<!--                          -->
                                                <td width="20%">
                        <input type="checkbox" name="am[17]" />
                        Arcade
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[18]" />

                        Casino
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[19]" />
                        Night Club
                                                </td>
<!--                          -->
                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[20]" />

                        Restaurant
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[21]" />
                        Bar
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[22]" />
                        Panoramic Bar
                                                </td>

<!--                          -->
                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[23]" />
                        Video Screen in Lounge/Bar
                                                </td>
<!--                          -->
                                                                    </tr>
                </tr>
            </table>

        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr>
                    <td><strong>Specific:</strong></td>

                </tr>
                <tr>

<!--                          -->
                                                <td width="20%">
                        <input type="checkbox" name="am[24]" />
                        Garage / Carpark
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[25]" />

                        Laundry service
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[26]" />
                        Pets Allowed (5 Kg)
                                                </td>
<!--                          -->
                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[27]" />

                        Room Service
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[28]" />
                        Banquet Facilities
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[29]" />
                        Shoe Shine
                                                </td>

<!--                          -->
                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[30]" />
                        Dry Cleaning Service
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[31]" />
                        Meeting Facilities (Small Groups)
                                                </td>

<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[32]" />
                        Children over 14 years old stay free
                                                </td>
<!--                          -->
                                                </tr><tr>
                                                                        <td width="20%">
                        <input type="checkbox" name="am[33]" />
                        Elevator(s)
                                                </td>

<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[34]" />
                        Wake Up Service/Calls
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[35]" />
                        Other
                        
                                                                                    <input type="text" name="h_other_amenity" value="" size="10" maxlength="20"
                             onKeyDown="textCounter(document.hotel_form.h_other_amenity,2,20)"
                             onKeyUp="textCounter(document.hotel_form.h_other_amenity,2,20)"  />[<span id="remLen2">20</span> characters left]

                                                </td>
<!--                          -->
                                                </tr><tr>
                                                                    </tr>
                </tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>

    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr>
                    <td><strong>Accomodation:</strong></td>
                </tr>
                <tr>

<!--                          -->

                                                <td width="20%">
                        <input type="checkbox" name="am[48]" />
                        Bed & breakfast
                                                </td>
<!--                          -->
                                                                        <td width="20%">
                        <input type="checkbox" name="am[49]" />
                        Airport Transfer
                                                </td>
<!--                          -->

                                                                    </tr>
                </tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>

    <tr bgcolor="#FFE0B3">
        <td colspan="2">

            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr><td colspan="5"><strong>Property information:</strong></td></tr>
                <tr>
                    <td align="right">Check in time</td>
                    <td><input name="h_checkin_time" type="text" size="5" maxlength="5" value="13:00:00" /></td>
                    <td align="right">Check out time</td>
                    <td><input name="h_checkout_time" type="text" size="5" maxlength="5" value="12:00:00" /></td>

                    <td width="60%"></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">

                <tr><td><strong>Area activities </strong>(describe freely)<strong>:</strong></td></tr>
                <tr><td><textarea rows="3" cols="80" name="h_area_activities"></textarea></td></tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
    <tr bgcolor="#FFE0B3">

        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr><td><strong>Statistics:</strong></td></tr>
                <tr>
                    <td width="16%" align="right">Airport Distance:</td>
                    <td width="16%"><input name="h_airport_distance" type="text" size="5" maxlength="5" value="0" /> Km</td>
                    <td width="16%" align="right">Nearest Bus Stop:</td>

                    <td width="16%"><input name="h_nearest_bus_stop" type="text" size="5" maxlength="5" value="0" /> meters</td>
                    <td width="16%" align="right">Floors:</td>
                    <td width="16%"><input name="h_floors" type="text" size="5" maxlength="5" value="0" /></td>
                </tr>
                <tr>
                    <td align="right">Medical Center:</td>
                    <td><input name="h_resort_city_center" type="text" size="5" maxlength="5" value="0" /> Km</td>

                    <td align="right">Resort/City Center:</td>
                    <td><input name="h_medical_center" type="text" size="5" maxlength="5" value="0" /> Km</td>
                                        <td align="right">Ski Slope:</td>
                    <td><input name="h_ski_slope" type="text" size="5" maxlength="5" value="0" /> Km</td>
                                                                                                </tr>
                <tr>

                                        <td align="right">Total capacity:</td>
                    <td><input name="h_total_rooms" type="text" size="5" maxlength="5" value="0" /> rooms</td>
                    <td colspan="4"></td>
                                                        </tr>
            </table>
        </td>
    </tr>

    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr><td><strong>Location:</strong>
                    <select name="location_id">
                        <option value="0"> - Select -</option>

                        <option label="b" value="32">b</option>
<option label="dd" value="47">dd</option>
<option label="dsfs" value="38">dsfs</option>
<option label="Pic me" value="33">Pic me</option>
<option label="qwert" value="44">qwert</option>
<option label="qwerty" value="40">qwerty</option>
<option label="sdfssd" value="46">sdfssd</option>
<option label="sfdfsdsd" value="34">sfdfsdsd</option>

<option label="Sofia" value="43">Sofia</option>
<option label="test" value="39">test</option>

                    </select>
                </td></tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>

    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr><td><strong>Small preview text:</strong></td></tr>
                                                <tr><td>
                    <textarea id="h_small_text" rows="3" cols="80" name="h_small_text"
                                     onKeyDown="textCounter(document.hotel_form.h_small_text,1,250)"
                                     onkeyup="textCounter(document.hotel_form.h_small_text,1,250)">ff</textarea>[<span id="remLen1">248</span> characters left]</td></tr>

            </table>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr><td><strong>Main offer text:</strong></td></tr>

                <tr><td><textarea id="tiny_mce2" cols="100" rows="15" name="h_main_text">dfdfdf</textarea></td></tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">

    <tr><td colspan="3"><strong>Photos:</strong></td></tr>
    <!--leave these comments below-->
    <!---->
        <!---->
    <input type="hidden" name="pictures[1][picture_id]" value="0" />
    <tr valign="top">
        <td width="1" align="center">
            Photo 1:<br />

            <img alt="no image" src="images/no_image.gif" />        </td>
        <td width="1">&nbsp;</td>
        <td width="90">Position:<br /><br />
            <select name="pictures[1][picture_position]">
                <option value="0"> - none - </option>
                <option label="1" value="1" selected="selected">1</option>

<option label="2" value="2">2</option>
<option label="3" value="3">3</option>
<option label="4" value="4">4</option>
<option label="5" value="5">5</option>

            </select>
        </td>
        <td>Upload new:<br /><br />
            <input type="file" name="images[1]" value="">        </td>

        <td></td>
        <td></td>
    </tr>
        <!---->
    <input type="hidden" name="pictures[2][picture_id]" value="0" />
    <tr valign="top">
        <td width="1" align="center">
            Photo 2:<br />

            <img alt="no image" src="images/no_image.gif" />        </td>
        <td width="1">&nbsp;</td>
        <td width="90">Position:<br /><br />
            <select name="pictures[2][picture_position]">
                <option value="0"> - none - </option>
                <option label="1" value="1">1</option>

<option label="2" value="2" selected="selected">2</option>
<option label="3" value="3">3</option>
<option label="4" value="4">4</option>
<option label="5" value="5">5</option>

            </select>
        </td>
        <td>Upload new:<br /><br />
            <input type="file" name="images[2]" value="">        </td>

        <td></td>
        <td></td>
    </tr>
        <!---->
    <input type="hidden" name="pictures[3][picture_id]" value="0" />
    <tr valign="top">
        <td width="1" align="center">
            Photo 3:<br />

            <img alt="no image" src="images/no_image.gif" />        </td>
        <td width="1">&nbsp;</td>
        <td width="90">Position:<br /><br />
            <select name="pictures[3][picture_position]">
                <option value="0"> - none - </option>
                <option label="1" value="1">1</option>

<option label="2" value="2">2</option>
<option label="3" value="3" selected="selected">3</option>
<option label="4" value="4">4</option>
<option label="5" value="5">5</option>

            </select>
        </td>
        <td>Upload new:<br /><br />
            <input type="file" name="images[3]" value="">        </td>

        <td></td>
        <td></td>
    </tr>
        <!---->
    <input type="hidden" name="pictures[4][picture_id]" value="0" />
    <tr valign="top">
        <td width="1" align="center">
            Photo 4:<br />

            <img alt="no image" src="images/no_image.gif" />        </td>
        <td width="1">&nbsp;</td>
        <td width="90">Position:<br /><br />
            <select name="pictures[4][picture_position]">
                <option value="0"> - none - </option>
                <option label="1" value="1">1</option>

<option label="2" value="2">2</option>
<option label="3" value="3">3</option>
<option label="4" value="4" selected="selected">4</option>
<option label="5" value="5">5</option>

            </select>
        </td>
        <td>Upload new:<br /><br />
            <input type="file" name="images[4]" value="">        </td>

        <td></td>
        <td></td>
    </tr>
        <!---->
    <input type="hidden" name="pictures[5][picture_id]" value="0" />
    <tr valign="top">
        <td width="1" align="center">
            Photo 5:<br />

            <img alt="no image" src="images/no_image.gif" />        </td>
        <td width="1">&nbsp;</td>
        <td width="90">Position:<br /><br />
            <select name="pictures[5][picture_position]">
                <option value="0"> - none - </option>
                <option label="1" value="1">1</option>

<option label="2" value="2">2</option>
<option label="3" value="3">3</option>
<option label="4" value="4">4</option>
<option label="5" value="5" selected="selected">5</option>

            </select>
        </td>
        <td>Upload new:<br /><br />
            <input type="file" name="images[5]" value="">        </td>

        <td></td>
        <td></td>
    </tr>
    </table>        </td>
    </tr>
<!--     <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr> -->
<!--
    <tr bgcolor="#FFE0B3">
        <td colspan="2">
            <table bgcolor="#FFEBCC" width="90%" cellpadding="2" cellspacing="1">
                <tr><td><strong>AA:</strong></td></tr>
                <tr><td>AA</td></tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="#FFE0B3"><td colspan="2"></td></tr>
-->
    <tr bgcolor="#FFE0B3"><td colspan="2"><input type="submit" name="submit" value="Submit changes" /></td></tr>
</table>
</form>


<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

<!--<script type="text/javascript">
var ddmx = new DropDownMenuX('menu1');
ddmx.delay.show = 0;
ddmx.delay.hide = 400;
ddmx.position.levelX.left = 2;
ddmx.init();
</script>-->

</body>
</html>

Posted: Sun Sep 25, 2005 5:04 pm
by feyd
checkRequiredFields() uses the old code.

Posted: Sun Sep 25, 2005 5:08 pm
by jmut
feyd wrote:checkRequiredFields() uses the old code.
I don't even call this function..

Code: Select all

<td colspan="10" align="left" valign="top"><button onclick="do_me()">Rooms</button></td>

Posted: Sun Sep 25, 2005 5:16 pm
by feyd
that function is still parsed. The line referenced in the error is the exact line that call falls on.

Posted: Sun Sep 25, 2005 5:30 pm
by jmut
feyd wrote:that function is still parsed. The line referenced in the error is the exact line that call falls on.
No its not....
its the one in the do_me() function
JS gives no error on load.....the error appears when I click the button

Posted: Sun Sep 25, 2005 5:36 pm
by feyd
In the code you posted, it is that line from checkRequiredFields(), not from do_me().

Posted: Sun Sep 25, 2005 6:13 pm
by jmut
feyd wrote:In the code you posted, it is that line from checkRequiredFields(), not from do_me().
Ok..I am sorry if this was the case..I even tried deleting the function in question ...its the do_me()...
I already did this with php :(
So stupid problem.
Thanks for the help....Have now idea why this is so..
Have to sleep now.