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
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script type='text/javascript'>
- $(function() {
- $('#editmovie').submit(function(event) {
- event.preventDefault()
- var title1 = $('#editmovie [name="titlea"]').val();
- var imdb1 = $('#editmovie [name="imdba"]').val();
- var genre_11 = $('#editmovie [name="genre_1a"]').val();
- var genre_21 = $('#editmovie [name="genre_2a"]').val();
- var genre_31 = $('#editmovie [name="genre_3a"]').val();
- var difficulty1 = $('#editmovie [name="difficultya"]').val();
- var rule_11 = $('#editmovie [name="rule_1a"]').val();
- var rule_21 = $('#editmovie [name="rule_2a"]').val();
- var rule_31 = $('#editmovie [name="rule_3a"]').val();
- var rule_41 = $('#editmovie [name="rule_4a"]').val();
- var rule_51 = $('#editmovie [name="rule_5a"]').val();
- var actor_11 = $('#editmovie [name="actor_1a"]').val();
- var actor_21 = $('#editmovie [name="actor_2a"]').val();
- var actor_31 = $('#editmovie [name="actor_3a"]').val();
- var actor_41 = $('#editmovie [name="actor_4a"]').val();
- var actor_51 = $('#editmovie [name="actor_5a"]').val();
- var actor_61 = $('#editmovie [name="actor_6a"]').val();
- var actor_71 = $('#editmovie [name="actor_7a"]').val();
- var suggest1 = $('#editmovie [name="suggesteda"]').val();
- var amazon1 = $('#editmovie [name="amazona"]').val();
- var type1 = $('#editmovie [name="typea"]').val();
- var spelling1 = $('#editmovie [name="spellinga"]').val();
- $.ajax({type: 'POST', url: 'submit-edited-movie.php', cache: false, timeout: 10000,
- 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},
- success: function() {
- alert('The movie has been edited');
- },
- error: function() {
- alert('There was a problem');
- },
- });
- });
- });
- </script>
-
- <form id="editmovie">
- Title:
- <input name="titlea" value="<?php echo $title; ?>" size="30"><br>
- IMDB:
- <input name="imdba" value="<?php echo $imdb; ?>" size="30"><br>
- <span class="rulesub"></span>
- <select size="1" name="genre_1a">
- <option value="<?php echo $genre_1; ?>"><?php echo $genre_1; ?></option>
- <?php include"include/genre.php" ?>
- <select size="1" name="genre_2a">
- <option value="<?php echo $genre_2; ?>"><?php echo $genre_2; ?></option>
- <?php include"include/genre.php" ?>
- <select size="1" name="genre_3a">
- <option value="<?php echo $genre_3; ?>"><?php echo $genre_3; ?></option>
- <?php include"include/genre.php" ?>
- <br />Difficulty:
- <select size="1" name="difficultya">
- <option value="<?php echo $difficulty; ?>"><?php echo $difficulty; ?></option>
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- </select><br />
- Rule 1:
- <textarea name="rule_1a" rows="1" cols="50"><?php echo $rule_1; ?></textarea><br>
- Rule 2:
- <textarea name="rule_2a" rows="1" cols="50"><?php echo $rule_2; ?></textarea><br>
- Rule 3:
- <textarea name="rule_3a" rows="1" cols="50"><?php echo $rule_3; ?></textarea><br>
- Rule 4:
- <textarea name="rule_4a" rows="1" cols="50"><?php echo $rule_4; ?></textarea><br>
- Rule 5:
- <textarea name="rule_5a" rows="1" cols="50"><?php echo $rule_5; ?></textarea><br>
- Actor 1:
- <input name="actor_1a" value="<?php echo $actor_1; ?>" size="30"><br>
- Actor 2:
- <input name="actor_2a" value="<?php echo $actor_2; ?>" size="30"><br>
- Actor 3:
- <input name="actor_3a" value="<?php echo $actor_3; ?>" size="30"><br>
- Actor 4:
- <input name="actor_4a" value="<?php echo $actor_4; ?>" size="30"><br>
- Actor 5:
- <input name="actor_5a" value="<?php echo $actor_5; ?>" size="30"><br>
- Actor 6:
- <input name="actor_6a" value="<?php echo $actor_6; ?>" size="30"><br>
- Actor 7:
- <input name="actor_7a" value="<?php echo $actor_7; ?>" size="30"><br>
- Suggested By:
- <input name="suggesteda"><br>
- Amazon:
- <textarea name="amazona" rows="1" cols="50"><?php echo $amazon; ?></textarea><br>
- <select size="1" name="typea">
- <option value="<?php echo $type; ?>" selected><?php echo $type; ?></option>
- <option value="movie">Movie</option>
- <option value="tv">T.V.</option>
- </select>
- <br />
- The spelling and grammer has been checked:
- <input type="checkbox" name="spelling" value="1" /><br>
- <input type="submit" value="Edit Movie">
- </form><br />
- </div>