jquery form select (if exists in $_POST)

Posted by SoulieBaby on Stack Overflow See other posts from Stack Overflow or by SoulieBaby
Published on 2010-04-21T02:39:26Z Indexed on 2010/04/21 2:43 UTC
Read the original article Hit count: 299

Filed under:
|
|
|

Hi all,

I'm trying to redo this in jQuery:

<script language="JavaScript" type="text/javascript">
  var thisIsSelected = '<?php echo $_POST['image']; ?>';
  var sel1= document.getElementById('image');
  sel1.value = thisIsSelected;
</script>

But I seem to keep breaking it lol

Basically I want jQuery to check if $_POST['image'] exists and if so make it selected on the form. I'm assuming if it's possibly with javascript, jquery can do it easier ;)

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about form