1

What am I missing here? If I try to submit the form via javascript it doesn't work.

Error (submitting with a regular JS reference and jQuery reference returns the same error)

 SCRIPT3: Member not found.

Code:

<a href="#" onclick="refresh_customer_data();return false;">Refresh customer data</a>
<script type="text/javascript">
function refresh_customer_data()
{
 $("#post-form").attr("action", "../scripts/refresh-customer-data.asp");
 $("#post-form").submit();
}
 </script>
<form method="post" action="" id="post-form">
<input type="hidden" name="fromsubmit" value="true" />
<table class="form" style="height:50px;">
<tfoot>
 <tr>
 <td><span class="required">*</span> Accessible by administrators only</td>
 <td><input type="submit" name="submit" value="" style="display:none;" /></td>
 </tr> 
</tfoot>
</table>
</form> 

Thanks!

asked May 14, 2012 at 17:15

3 Answers 3

1

Why not use jQuery post to send your data to server page like this

<a href="#" id="aRefresh">Refresh customer data</a>

Javascript:

$(function(){
 $("#aRefresh").click(function(e){
 e.preventDefault();
 $.post("../scripts/refresh-customer-data.asp", $("#post-form").serialize(),function(data){
 //do whatever with the response from server page
 }) 
 });
 });
Jon Adams
25.3k18 gold badges85 silver badges122 bronze badges
answered May 14, 2012 at 17:27
Sign up to request clarification or add additional context in comments.

2 Comments

Force of habit mostly, I'll check out your method too.
Nevermind, self-inflicted misery. Was doing something on document.ready that interfered with the submit method. Will flip a coin between you and Lokase for the checkmark.
1

Instead of inline calling the function, why not use jQuery to do it for you:

http://jsfiddle.net/8XdwS/

answered May 14, 2012 at 17:21

2 Comments

I still get the member not found error with that code. Weird thing is if I move the </form> tag to right after the hidden input value, it works fine. Only when I put it after the table element does it fail. In all instances.
Nevermind, self-inflicted misery. Was doing something on document.ready that interfered with the submit method. Will flip a coin between you and Shyju for the checkmark.
1

I know this is an old thread but for everybody's information:

I have come across this issue as well, and the problem was having the submit button named submit.

Renaming the submit button ie. to submit2 solved the issue.

answered Jul 1, 2014 at 14:55

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.