Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   How to get the form value if the value have the & symbol inside (http://www.go4expert.com/forums/form-value-value-symbol-inside-t608/)

dormingo 3Mar2006 09:49

How to get the form value if the value have the & symbol inside
 
Hello buddy, I have a problem of passing the Value in HTML Form to the VB Script function.

Like example: My Text1 value="1234&abc"

when pass the Text1 value to the Function(Text1.value), The Value pass in it will be 1234.
but the actual is 1234&abc. ( Client Side )

How Should I solve this Problem.....? Thank you...

The Source Code:
<html>
<form name="form1">
<input type="text" name="refno" value="1234&abcde"><input type="button" value="Submit"onclick="CheckSubmit(document.form1. refno.value)">
</form>
</html>
<script language="vbscript">
function CheckSubmit(refno)

document.write(refno) ' The result will be 1234 Only, not 1234&abcde

end function

shabbir 3Mar2006 18:36

Re: How to get the form value if the value have the & symbol inside
 
Can you provide the complete code where this thing is happening.

coderzone 5Mar2006 11:29

Re: How to get the form value if the value have the & symbol inside
 
The problem is not with the passing of the variable but its the problem with the printing of value in the document.

Try doing this and all should be fine
Code:

document.write("<PRE>")
document.write(refno) ' The result will be 1234&abcde and not 1234
document.write("</PRE>")

Happy coding.

shabbir 5Mar2006 11:32

Re: How to get the form value if the value have the & symbol inside
 
I never knew you have edited the post to include the Code. Making a new post sends an email to all the posters of the thread and so it helps evryone to reply. If you just edit the new post try posting a line like I have edited the tread to include the code so that everyone knows.

Also yes you have the solution now probably.


All times are GMT +5.5. The time now is 21:53.