Jump to content

CreativeDesign111

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

CreativeDesign111's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I believe this question will involve AJAX, jQuery, PHP, and sessions. I've tried for days and can't crack this. Starting fresh after many walks. I simply want a form with a dropdown box that does NOT refresh/reload the screen. Saves the selection as a SESSION and "selects" or highlights the dropdown choice based on the session they just set. So in a nutshell... - Client selects the option (must use onchange event instead of clicking submit) - using jQuery / AJAX this helps to prevent the page from reloading (correct?) - dropdown choice is "remembered" because it uses the session to compare and "selects" it. - Also able to echo / print the session on the same page. I'm going to be using this simple example in multiple steps of an ordering form which uses check boxes, radios, input boxes, and dropdown menu. If anyone knows of a simple example using a dropdown box, that would get me started. The attempts I had before would only set a session using the first or last of the dropdown list instead of the one chosen.
  2. Please tell me that the top programmers in the world make mistakes this simple... because this is embarrassing!! somehow copied and pasted my code into the WordPress page and didn't end the form tag. I missed the </form> tag! I'll go crawl in a hole now.
  3. Hello, first time poster.. I've looked the web over for a long time and can't figure this one out. - Below is basic code that successfully checks MySQL for a match and displays result. I was debugging and forced the "height" and "width" to be 24 and 36 to make sure that wasn't the problem. That's good.. - I'd like to give the user ability to select width and height from a form.. and have it do an onchange this.form.submit so the form can be changing as fields are altered (thus the onchange interaction) - In a normal coding environment I've done this numerous times with no "Page cannot be displayed" problems. It would simply change one select-option value at a time til they get down the form and click submit... but in WordPress I'm having trouble making even ONE single onchange work! - I've implemented the plugins they offer which allows you to "copy+paste" your php code directly into their wysiwyg editor. That works with basic tests like my first bullet point above. - I've copied and pasted the wordpress url (including the little ?page_id=123) into the form "action" url... that didn't work... tried forcing it into an <option value=""> tag.. didn't work. I'm just not sure. I've obviously put xx's in place of private info.. Why does this form give me Page Cannot Be Displayed in WordPress every time? It won't do anything no matter how simple.. using onchange.. Code.. $con = mysql_connect("xxxx.xxxxxxx.com","xxxxxx","xxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxxxxx", $con); $myprodwidth=24; $myprodheight=36; $result = mysql_query("SELECT * FROM product_sizes WHERE prodwidth='$myprodwidth' and prodheight='$myprodheight'"); while($row = mysql_fetch_array($result)) { echo $row['prodprice']; } mysql_close($con); <form method="post" action=""> <select name="myheight" onchange="this.form.submit();"> <option selected="selected" value="">select height</option> <option value="xxxxxxxxx.com/wordpress/?page_id=199&height=36">36</option> <option value="xxxxxxxxx.com/wordpress/?page_id=199&height=36">48</option> </select>
×
×
  • 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.