Jump to content

[SOLVED] can't get a select box to update


todm

Recommended Posts

Pictures.php has a form with 4 different select boxes.  The select boxes update a div (pictsdisp.php).  The first 3 select boxes work fine.  I'm having a hell of a time with the 4th. 

 

I need to get the div area (pictsdisp.php) to update options in the 4th select box.  Then, that 4th select box would need to modify the div (if it's changed).

 

Basically, I need to figure out how to get the div area to call a javascript function.  This is what I'm trying...

print "<script language=\"JavaScript\">\n";
print "<!--\n";
print "fnPageNavigation(" . $pageNum . "," . $numberOfPages . ");\n";
print "-->\n";
print "</script>\n";

 

(fnPageNavigation is a function within pictures.js, which is loaded in the header)

 

If I add a new select box to the div area, I am able to get that to update the 4th select box.  However, I want that box to be updated without any user interaction.

 

 

Any suggestions?  I'm pretty new to Javascript & AJAX.

Link to comment
https://forums.phpfreaks.com/topic/111303-solved-cant-get-a-select-box-to-update/
Share on other sites

Trying to clarify...

 

If I add a submit button with an "onblur" calling the function, it does what I want it to.  However, I don't want users to have to do that...  I would like the function to be called every time that page is loaded.

 

Again, the code below works, but I want to replace the button so the script is always called.

<input name="pageNav" id="id" type="submit" value="value" onblur="fnPageNavigation($pageNum, $numberOfPages)">

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.