2012-06-07 4 views
1

내 프로필 편집 페이지의 내 이미지 업로드 양식이 작동하지 않습니다. 두 양식은 독립적으로 작동하므로 별도로 작성해야합니다. 이미지 업로드 스크립트는 프로필 편집 양식을 제출하기 전에 이미지를 업로드합니다.한 페이지에 두 개 이상의 양식이 있습니다.

이미지 업로드가 페이지의 유일한 것이고 작동하는 별도의 페이지에서 테스트되었습니다. 그래서 나는 그것을 엉망으로 만드는 다른 형태라고 가정하고 있습니다. 두 양식은 다른 스크립트에서 작동하며 두 방법 모두 게시물입니다. 여기

는 다음의 JScript

<script type="text/javascript" src="imageupload/scripts/jquery.min.js"></script> 
<script type="text/javascript" src="imageupload/scripts/jquery.form.js"></script> 
<script type="text/javascript" > 
    $(document).ready(function() { 
    $('#photoimg').live('change', function() { 
     $("#preview").html(''); 
     $("#preview").html('<img src="imageupload/loader.gif" alt="Uploading...."//>'); 
     $("#cropimage").ajaxForm({ target: '#preview' }).submit(); 
    }); 
    }); 
</script> 

인 형태이다;

<form id="cropimage" method="post" enctype="multipart/form-data" action="../imageupload/ajaximage.php"> 
    <input type="file" name="photoimg" id="photoimg" class="filebutton"/><br> 
</form> 

다른 형태가 있습니다. 그 긴 하나;

echo '<form action="phpscripts/artistupdate.php" method="post" id="profileedit"><input type="text" name="artistname" value="'. $row['artistname'].'" class="name"  maxlength="80"><span id="editlink"><t1>Your profile link will be: <br><a  href="http://newbornsounds.co.uk/artists/artist.php?artist='.$row['artistname'].'"> <b>http://newbornsounds.co.uk/artists/artist.php?artist=<FONT style="BACKGROUND-COLOR: yellow">'.$row['artistname'].'</font></b></a></span><br><div id="urlwarn"><t1>Please note that if you change your url all the links you have placed outside of NBS will be affected.</t1></div>'; 
    } 
} 
?> 
<hr> 
<?php 
    $username = $_SESSION['username']; 
    $pass = $_SESSION['password']; 
    include ("../database.php"); 
    $result = mysql_query("SELECT * FROM members WHERE username='$username' AND  password='$pass' AND artist='Y'"); 

    while($row = mysql_fetch_array($result)){ 
    echo '<div id="artistsbio"><textarea name="bio" rows="10" cols="80" name="bio" value="'.  $row['bio']. '" class="bio">'. $row['bio']. '</textarea><br><div id="probwarn"><t1>Everything is still in the beta stage so there are bound to be a few problems. If you spot one please <a  href="mailto:[email protected]"><b>tell us about it.</b></a></t1></div>'; 
    } 
?> 
<br><br> 
<input type="submit" name="submit" value="Done" class="button"></form> 
+1

양식의 전체 HTML은 어떻게 생겼습니까? 양식을 중첩 할 수 없습니다. – jeroen

+0

다른 양식은 어디에 있습니까? –

+0

각 양식에 대해 두 개의 제출 단추가 있는지 확인하십시오. –

답변

0

작물 이미지에 제출 버튼이 없습니다.이 버튼은 pb 일 수 있습니다. 잘 이해하면 제출 단추없이 photimg 필드에 변경 사항이있을 때 제출하기를 원합니다.

시도해주세요. 표시하지 않으려면 화면 외부에 제출 버튼을 표시하십시오. Submitting a form by pressing enter without a submit button 을 시도하십시오.

현재 jquery live는 더 이상 사용되지 않습니다. http://api.jquery.com/live/

+0

답변 해 주셔서 감사합니다. 나는 지금 그것을 알아 냈다. 내 memberstoolbar에서 javascript를 끄면 양식을 제출하는 javascript 줄이 엉망이되었습니다. 하지만 .live 함수는 사용되지 않습니다. 실현하지 못했습니다 –

+0

이상한, 나는 라이브를 켜기로했지만 더 이상 작동하지 않습니다. 무슨 일이야? –

관련 문제