Passing a url and HTML in a variable

Passing a url and HTML in a variable

I have a form set up that in on of the input boxes a url and some html will have to be passed along. The form works just fine as long as there is no url or html, if there is I get the "there was a problem" alert. How would I go about allowing the IMDB and amazon inputs be allowed to pass along html or a url?

Thanks

  1. <script src="http://code.jquery.com/jquery-latest.js"></script>
  2. <script type='text/javascript'>
  3. $(function() {
  4.     $('#editmovie').submit(function(event) {
  5.            event.preventDefault()
  6.           var title1 = $('#editmovie [name="titlea"]').val();
  7. var imdb1 = $('#editmovie [name="imdba"]').val();
  8. var genre_11 = $('#editmovie [name="genre_1a"]').val();
  9. var genre_21 = $('#editmovie [name="genre_2a"]').val();
  10. var genre_31 = $('#editmovie [name="genre_3a"]').val();
  11. var difficulty1 = $('#editmovie [name="difficultya"]').val();
  12. var rule_11 = $('#editmovie [name="rule_1a"]').val();
  13. var rule_21 = $('#editmovie [name="rule_2a"]').val();
  14. var rule_31 = $('#editmovie [name="rule_3a"]').val();
  15. var rule_41 = $('#editmovie [name="rule_4a"]').val();
  16. var rule_51 = $('#editmovie [name="rule_5a"]').val();
  17. var actor_11 = $('#editmovie [name="actor_1a"]').val();
  18. var actor_21 = $('#editmovie [name="actor_2a"]').val();
  19. var actor_31 = $('#editmovie [name="actor_3a"]').val();
  20. var actor_41 = $('#editmovie [name="actor_4a"]').val();
  21. var actor_51 = $('#editmovie [name="actor_5a"]').val();
  22. var actor_61 = $('#editmovie [name="actor_6a"]').val();
  23. var actor_71 = $('#editmovie [name="actor_7a"]').val();
  24. var suggest1 = $('#editmovie [name="suggesteda"]').val();
  25. var amazon1 = $('#editmovie [name="amazona"]').val();
  26. var type1 = $('#editmovie [name="typea"]').val();
  27.       var spelling1 = $('#editmovie [name="spellinga"]').val();
  28.           $.ajax({type: 'POST', url: 'submit-edited-movie.php', cache: false, timeout: 10000,
  29.                  data: {title_sub: title1, imdb_sub: imdb1, genre_1_sub: genre_11, genre_2_sub: genre_21, genre_3_sub: genre_31, difficulty_sub: difficulty1, rule_1_sub: rule_11, rule_2_sub: rule_21, rule_3_sub: rule_31, rule_4_sub: rule_41, rule_5_sub: rule_51, actor_1_sub: actor_11, actor_2_sub: actor_21, actor_3_sub: actor_31, actor_4_sub: actor_41, actor_5_sub: actor_51, actor_6_sub: actor_61, actor_7_sub: actor_71, suggest_sub: suggest1, amazon_sub: amazon1, type_sub: type1, spelling_sub: spelling1},
  30.                  success: function() {
  31.                        alert('The movie has been edited');
  32.                  },
  33.                  error: function() {
  34.                        alert('There was a problem');
  35.                  },
  36.            });
  37.     });
  38. });

  39. </script>
  40. <form id="editmovie">
  41.                 Title:
  42. <input name="titlea" value="<?php echo $title; ?>" size="30"><br>
  43. IMDB:
  44. <input name="imdba" value="<?php echo $imdb; ?>" size="30"><br>
  45. <span class="rulesub"></span>
  46. <select size="1" name="genre_1a">
  47. <option value="<?php echo $genre_1; ?>"><?php echo $genre_1; ?></option>
  48. <?php include"include/genre.php" ?>
  49. <select size="1" name="genre_2a">
  50. <option value="<?php echo $genre_2; ?>"><?php echo $genre_2; ?></option>
  51. <?php include"include/genre.php" ?>
  52. <select size="1" name="genre_3a">
  53. <option value="<?php echo $genre_3; ?>"><?php echo $genre_3; ?></option>
  54. <?php include"include/genre.php" ?>
  55. <br />Difficulty:
  56. <select size="1" name="difficultya">
  57. <option value="<?php echo $difficulty; ?>"><?php echo $difficulty; ?></option>
  58. <option value="1">1</option>
  59. <option value="2">2</option>
  60. <option value="3">3</option>
  61. <option value="4">4</option>
  62. <option value="5">5</option>
  63. </select><br />
  64. Rule 1:
  65. <textarea name="rule_1a" rows="1" cols="50"><?php echo $rule_1; ?></textarea><br>
  66. Rule 2:
  67. <textarea name="rule_2a" rows="1" cols="50"><?php echo $rule_2; ?></textarea><br>
  68. Rule 3:
  69. <textarea name="rule_3a" rows="1" cols="50"><?php echo $rule_3; ?></textarea><br>
  70. Rule 4:
  71. <textarea name="rule_4a" rows="1" cols="50"><?php echo $rule_4; ?></textarea><br>
  72. Rule 5:
  73. <textarea name="rule_5a" rows="1" cols="50"><?php echo $rule_5; ?></textarea><br>
  74. Actor 1:
  75. <input name="actor_1a" value="<?php echo $actor_1; ?>" size="30"><br>
  76. Actor 2:
  77. <input name="actor_2a" value="<?php echo $actor_2; ?>" size="30"><br>
  78. Actor 3:
  79. <input name="actor_3a" value="<?php echo $actor_3; ?>" size="30"><br>
  80. Actor 4:
  81. <input name="actor_4a" value="<?php echo $actor_4; ?>" size="30"><br>
  82. Actor 5:
  83. <input name="actor_5a" value="<?php echo $actor_5; ?>" size="30"><br>
  84. Actor 6:
  85. <input name="actor_6a" value="<?php echo $actor_6; ?>" size="30"><br>
  86. Actor 7:
  87. <input name="actor_7a" value="<?php echo $actor_7; ?>" size="30"><br>
  88. Suggested By:
  89. <input name="suggesteda"><br>
  90. Amazon:
  91. <textarea name="amazona" rows="1" cols="50"><?php echo $amazon; ?></textarea><br>
  92. <select size="1" name="typea">
  93. <option value="<?php echo $type; ?>" selected><?php echo $type; ?></option>
  94. <option value="movie">Movie</option>
  95. <option value="tv">T.V.</option>
  96. </select>
  97. <br />
  98. The spelling and grammer has been checked:
  99. <input type="checkbox" name="spelling" value="1" /><br>
  100. <input type="submit" value="Edit Movie">
  101. </form><br />
  102. </div>