Dynamic DNS before and After Javascript problem

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
steedvlx
Forum Contributor
Posts: 122
Joined: Wed Jun 11, 2003 10:54 pm
Location: Osaka, Japan

Dynamic DNS before and After Javascript problem

Post by steedvlx »

Hello again guys [sic]

I have a small problem that maybe someone could please explain to me.

I have built a site using a combination of PhP and Javascript with a great deal of help from people here. Thanks for all the help.

The problem is with the site located at http://www.kokusaibuhin.com

The drop down lists and the matching GO! buttons used to take me to the right place. (At that time, I was using a dynamic DNS service that worked ok, but caused the URL in the address box to never change.)

So, I upgraded my Domain to Custom DNS (from dyndns.org) so that it is now directly addressable. Only now, the above GO! button code is broken! What the.....?

To see the identical code do what it is supposed to do, check out http://www.sgthost.dyndns.org . (You can use the English link to access an identical page just in English if you want to)

Can anyone tell me what is going on here? Just in case, below is the code for the entire form on the left side of the page.

Code: Select all

<form action="japanese/j_search.php" method="get" name="form2" target="_parent">
      <table width="239" height="33" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="27">&nbsp;</td>
          <td width="123" align="right" valign="middle"> <select name="cat_select" id="cat_select">
              <?php
do &#123;  
?>
              <option value="<?php echo $row_rs_categories&#1111;'prod_category_num']?>"><?php echo $row_rs_categories&#1111;'prod_category_j_name']?></option>
              <?php
&#125; while ($row_rs_categories = mysql_fetch_assoc($rs_categories));
  $rows = mysql_num_rows($rs_categories);
  if($rows > 0) &#123;
      mysql_data_seek($rs_categories, 0);
	  $row_rs_categories = mysql_fetch_assoc($rs_categories);
  &#125;
?>
            </select></td>
          <td width="32">&nbsp;</td>
          <td width="57"><a href="javascript:;" onClick="formButtonFever('form2','submit')"><img src="images/go.gif" width="50" height="25" border="0"></a></td>
        </tr>
      </table>
    </form>
Thanks
--------------------------
SteedVLX
User avatar
steedvlx
Forum Contributor
Posts: 122
Joined: Wed Jun 11, 2003 10:54 pm
Location: Osaka, Japan

Post by steedvlx »

Hey again.

Problem solved although it would still be nice to know why the javascript was broken by the above situation in the first place.

I simply changed this code in both forms>>

Code: Select all

<a href="javascript:;" onClick="formButtonFever('form2','submit')"><img src="images/go.gif" width="50" height="25" border="0">

to>>

Code: Select all

input name="Submit" type="image" value="<? echo $form_sel; ?>" src="images/go.gif" width="50" height="25">
It kind of avoids the problem while solving it at the same time. :oops:

Still interested in any thoughts on what happened in the first place...

Thanks
----------------------------
SteedVLX
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

First, both links look identical to me. BLANK!

I copied your source, and something in your javascript is screwy. I think
<a href="javascript:;" ...
is telling the form to do nothing, which it apparently does very well. This works:

Code: Select all

<a href="javascript:formButtonFever('form1','submit')"><img src="images/go.gif" width="50" height="25" border="0"></a>
But for the life of me, can't figure out why you don't just use the standard HTML and forget about the javascript until you really need it.

Code: Select all

<INPUT TYPE="image" NAME="imageSubmit" alt = "GO"  src = "images/go.gif"  width="50" height="25" >
User avatar
steedvlx
Forum Contributor
Posts: 122
Joined: Wed Jun 11, 2003 10:54 pm
Location: Osaka, Japan

Post by steedvlx »

The version of the page that is on sgthost.com uses the javascript code that I first posted. It works fine for submitting the form. (DNS Server changes may be responsible for the pages being blank where you are, but should be fine now.)

In my followup post, I did exactly what you are suggesting and just went with the HTML method for using the the image as a button. These changes were made to the version of the page at kokusaibuhin.com and works fine.

The reason I was using javascript in the first place was to learn how to use it and to see how it does what it does.

Thanks for the feedback.

---------------------------------
SteedVLX
Post Reply